소스 검색

fix bug where random sample was picking random references incorrectly

Daniel Sheffield 1 년 전
부모
커밋
586cf55382
1개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  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