Selaa lähdekoodia

fix bug where random sample was picking random references incorrectly

Daniel Sheffield 1 vuosi sitten
vanhempi
säilyke
586cf55382
1 muutettua tiedostoa jossa 4 lisäystä ja 1 poistoa
  1. 4 1
      create-views.sql

+ 4 - 1
create-views.sql

@@ -65,7 +65,10 @@ DECLARE
   v_table_id int;
   v_table text;
 BEGIN
-SELECT tableid, tablename, reltuples INTO v_table_id, v_table, v_estimate FROM pg_categories JOIN pg_class ON tablename = relname;
+SELECT tableid, tablename, reltuples INTO v_table_id, v_table, v_estimate
+FROM pg_categories
+JOIN pg_class ON tablename = relname
+WHERE p_name = name;
 SELECT 1000::double precision / v_estimate INTO v_percentage;
 RETURN QUERY EXECUTE 'SELECT '|| v_table_id ||' AS ordinal,
   '''|| p_name ||''' AS category, translation, reference