1 SELECT set_smlar_limit(0.3);
7 SET smlar.type = "tfidf";
8 SET smlar.stattable = "int4_stat";
9 UPDATE test_int4 SET v = v || '{50,50,50}'::int4[] WHERE t >=50 AND t < 60;
10 INSERT INTO test_int4 VALUES(201, '{50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50}');
11 CREATE TABLE int4_stat (
13 ndoc int4 NOT NULL CHECK (ndoc>0)
15 INSERT INTO int4_stat (
20 (SELECT array_to_col(v) AS w FROM test_int4 WHERE v IS NOT NULL) AS q
23 INSERT INTO int4_stat VALUES (NULL, (SELECT count(*) FROM test_int4));
24 DROP INDEX idx_test_int4;
25 SET smlar.tf_method = "n";
26 SET smlar.idf_plus_one = off;
27 SELECT smlar('{199,199,199,199,1}', '{199,1}'::int4[]);
33 SELECT t, smlar(v, '{10,9,8,7,6,5,4,3,2,1}') AS s FROM test_int4 WHERE v % '{10,9,8,7,6,5,4,3,2,1}' ORDER BY s DESC, t;
56 SELECT t, smlar(v, '{50,49,8,7,6,5,4,33,2,1}') AS s FROM test_int4 WHERE v % '{50,49,8,7,6,5,4,33,2,1}' ORDER BY s DESC, t;
63 SET smlar.tf_method = "n";
64 SET smlar.idf_plus_one = on;
65 SELECT smlar('{199,199,199,199,1}', '{199,1}'::int4[]);
71 SELECT t, smlar(v, '{10,9,8,7,6,5,4,3,2,1}') AS s FROM test_int4 WHERE v % '{10,9,8,7,6,5,4,3,2,1}' ORDER BY s DESC, t;
157 SELECT t, smlar(v, '{50,49,8,7,6,5,4,33,2,1}') AS s FROM test_int4 WHERE v % '{50,49,8,7,6,5,4,33,2,1}' ORDER BY s DESC, t;
247 SET smlar.tf_method = "log";
248 SET smlar.idf_plus_one = off;
249 SELECT smlar('{199,199,199,199,1}', '{199,1}'::int4[]);
255 SELECT t, smlar(v, '{10,9,8,7,6,5,4,3,2,1}') AS s FROM test_int4 WHERE v % '{10,9,8,7,6,5,4,3,2,1}' ORDER BY s DESC, t;
278 SELECT t, smlar(v, '{50,49,8,7,6,5,4,33,2,1}') AS s FROM test_int4 WHERE v % '{50,49,8,7,6,5,4,33,2,1}' ORDER BY s DESC, t;
285 SET smlar.tf_method = "log";
286 SET smlar.idf_plus_one = on;
287 SELECT smlar('{199,199,199,199,1}', '{199,1}'::int4[]);
293 SELECT t, smlar(v, '{10,9,8,7,6,5,4,3,2,1}') AS s FROM test_int4 WHERE v % '{10,9,8,7,6,5,4,3,2,1}' ORDER BY s DESC, t;
379 SELECT t, smlar(v, '{50,49,8,7,6,5,4,33,2,1}') AS s FROM test_int4 WHERE v % '{50,49,8,7,6,5,4,33,2,1}' ORDER BY s DESC, t;
469 SET smlar.tf_method = "const";
470 SET smlar.idf_plus_one = off;
471 SELECT smlar('{199,199,199,199,1}', '{199,1}'::int4[]);
477 SELECT t, smlar(v, '{10,9,8,7,6,5,4,3,2,1}') AS s FROM test_int4 WHERE v % '{10,9,8,7,6,5,4,3,2,1}' ORDER BY s DESC, t;
500 SELECT t, smlar(v, '{50,49,8,7,6,5,4,33,2,1}') AS s FROM test_int4 WHERE v % '{50,49,8,7,6,5,4,33,2,1}' ORDER BY s DESC, t;
507 SET smlar.tf_method = "const";
508 SET smlar.idf_plus_one = on;
509 SELECT smlar('{199,199,199,199,1}', '{199,1}'::int4[]);
515 SELECT t, smlar(v, '{10,9,8,7,6,5,4,3,2,1}') AS s FROM test_int4 WHERE v % '{10,9,8,7,6,5,4,3,2,1}' ORDER BY s DESC, t;
601 SELECT t, smlar(v, '{50,49,8,7,6,5,4,33,2,1}') AS s FROM test_int4 WHERE v % '{50,49,8,7,6,5,4,33,2,1}' ORDER BY s DESC, t;
691 CREATE INDEX idx_test_int4 ON test_int4 USING gist (v _int4_sml_ops);
692 SET enable_seqscan = off;
693 SET smlar.tf_method = "n";
694 SET smlar.idf_plus_one = off;
695 SELECT smlar('{199,199,199,199,1}', '{199,1}'::int4[]);
701 SELECT t, smlar(v, '{10,9,8,7,6,5,4,3,2,1}') AS s FROM test_int4 WHERE v % '{10,9,8,7,6,5,4,3,2,1}' ORDER BY s DESC, t;
724 SELECT t, smlar(v, '{50,49,8,7,6,5,4,33,2,1}') AS s FROM test_int4 WHERE v % '{50,49,8,7,6,5,4,33,2,1}' ORDER BY s DESC, t;
731 SET smlar.tf_method = "n";
732 SET smlar.idf_plus_one = on;
733 SELECT smlar('{199,199,199,199,1}', '{199,1}'::int4[]);
739 SELECT t, smlar(v, '{10,9,8,7,6,5,4,3,2,1}') AS s FROM test_int4 WHERE v % '{10,9,8,7,6,5,4,3,2,1}' ORDER BY s DESC, t;
825 SELECT t, smlar(v, '{50,49,8,7,6,5,4,33,2,1}') AS s FROM test_int4 WHERE v % '{50,49,8,7,6,5,4,33,2,1}' ORDER BY s DESC, t;
915 SET smlar.tf_method = "log";
916 SET smlar.idf_plus_one = off;
917 SELECT smlar('{199,199,199,199,1}', '{199,1}'::int4[]);
923 SELECT t, smlar(v, '{10,9,8,7,6,5,4,3,2,1}') AS s FROM test_int4 WHERE v % '{10,9,8,7,6,5,4,3,2,1}' ORDER BY s DESC, t;
946 SELECT t, smlar(v, '{50,49,8,7,6,5,4,33,2,1}') AS s FROM test_int4 WHERE v % '{50,49,8,7,6,5,4,33,2,1}' ORDER BY s DESC, t;
953 SET smlar.tf_method = "log";
954 SET smlar.idf_plus_one = on;
955 SELECT smlar('{199,199,199,199,1}', '{199,1}'::int4[]);
961 SELECT t, smlar(v, '{10,9,8,7,6,5,4,3,2,1}') AS s FROM test_int4 WHERE v % '{10,9,8,7,6,5,4,3,2,1}' ORDER BY s DESC, t;
1047 SELECT t, smlar(v, '{50,49,8,7,6,5,4,33,2,1}') AS s FROM test_int4 WHERE v % '{50,49,8,7,6,5,4,33,2,1}' ORDER BY s DESC, t;
1137 SET smlar.tf_method = "const";
1138 SET smlar.idf_plus_one = off;
1139 SELECT smlar('{199,199,199,199,1}', '{199,1}'::int4[]);
1145 SELECT t, smlar(v, '{10,9,8,7,6,5,4,3,2,1}') AS s FROM test_int4 WHERE v % '{10,9,8,7,6,5,4,3,2,1}' ORDER BY s DESC, t;
1168 SELECT t, smlar(v, '{50,49,8,7,6,5,4,33,2,1}') AS s FROM test_int4 WHERE v % '{50,49,8,7,6,5,4,33,2,1}' ORDER BY s DESC, t;
1175 SET smlar.tf_method = "const";
1176 SET smlar.idf_plus_one = on;
1177 SELECT smlar('{199,199,199,199,1}', '{199,1}'::int4[]);
1183 SELECT t, smlar(v, '{10,9,8,7,6,5,4,3,2,1}') AS s FROM test_int4 WHERE v % '{10,9,8,7,6,5,4,3,2,1}' ORDER BY s DESC, t;
1269 SELECT t, smlar(v, '{50,49,8,7,6,5,4,33,2,1}') AS s FROM test_int4 WHERE v % '{50,49,8,7,6,5,4,33,2,1}' ORDER BY s DESC, t;
1359 DROP INDEX idx_test_int4;
1360 CREATE INDEX idx_test_int4 ON test_int4 USING gin (v _int4_sml_ops);
1361 SET enable_seqscan = off;
1362 SET smlar.tf_method = "n";
1363 SET smlar.idf_plus_one = off;
1364 SELECT smlar('{199,199,199,199,1}', '{199,1}'::int4[]);
1370 SELECT t, smlar(v, '{10,9,8,7,6,5,4,3,2,1}') AS s FROM test_int4 WHERE v % '{10,9,8,7,6,5,4,3,2,1}' ORDER BY s DESC, t;
1371 ERROR: GIN supports only smlar.tf_method = "const"
1372 SELECT t, smlar(v, '{50,49,8,7,6,5,4,33,2,1}') AS s FROM test_int4 WHERE v % '{50,49,8,7,6,5,4,33,2,1}' ORDER BY s DESC, t;
1373 ERROR: GIN supports only smlar.tf_method = "const"
1374 SET smlar.tf_method = "n";
1375 SET smlar.idf_plus_one = on;
1376 SELECT smlar('{199,199,199,199,1}', '{199,1}'::int4[]);
1382 SELECT t, smlar(v, '{10,9,8,7,6,5,4,3,2,1}') AS s FROM test_int4 WHERE v % '{10,9,8,7,6,5,4,3,2,1}' ORDER BY s DESC, t;
1383 ERROR: GIN supports only smlar.tf_method = "const"
1384 SELECT t, smlar(v, '{50,49,8,7,6,5,4,33,2,1}') AS s FROM test_int4 WHERE v % '{50,49,8,7,6,5,4,33,2,1}' ORDER BY s DESC, t;
1385 ERROR: GIN supports only smlar.tf_method = "const"
1386 SET smlar.tf_method = "log";
1387 SET smlar.idf_plus_one = off;
1388 SELECT smlar('{199,199,199,199,1}', '{199,1}'::int4[]);
1394 SELECT t, smlar(v, '{10,9,8,7,6,5,4,3,2,1}') AS s FROM test_int4 WHERE v % '{10,9,8,7,6,5,4,3,2,1}' ORDER BY s DESC, t;
1395 ERROR: GIN supports only smlar.tf_method = "const"
1396 SELECT t, smlar(v, '{50,49,8,7,6,5,4,33,2,1}') AS s FROM test_int4 WHERE v % '{50,49,8,7,6,5,4,33,2,1}' ORDER BY s DESC, t;
1397 ERROR: GIN supports only smlar.tf_method = "const"
1398 SET smlar.tf_method = "log";
1399 SET smlar.idf_plus_one = on;
1400 SELECT smlar('{199,199,199,199,1}', '{199,1}'::int4[]);
1406 SELECT t, smlar(v, '{10,9,8,7,6,5,4,3,2,1}') AS s FROM test_int4 WHERE v % '{10,9,8,7,6,5,4,3,2,1}' ORDER BY s DESC, t;
1407 ERROR: GIN supports only smlar.tf_method = "const"
1408 SELECT t, smlar(v, '{50,49,8,7,6,5,4,33,2,1}') AS s FROM test_int4 WHERE v % '{50,49,8,7,6,5,4,33,2,1}' ORDER BY s DESC, t;
1409 ERROR: GIN supports only smlar.tf_method = "const"
1410 SET smlar.tf_method = "const";
1411 SET smlar.idf_plus_one = off;
1412 SELECT smlar('{199,199,199,199,1}', '{199,1}'::int4[]);
1418 SELECT t, smlar(v, '{10,9,8,7,6,5,4,3,2,1}') AS s FROM test_int4 WHERE v % '{10,9,8,7,6,5,4,3,2,1}' ORDER BY s DESC, t;
1441 SELECT t, smlar(v, '{50,49,8,7,6,5,4,33,2,1}') AS s FROM test_int4 WHERE v % '{50,49,8,7,6,5,4,33,2,1}' ORDER BY s DESC, t;
1448 SET smlar.tf_method = "const";
1449 SET smlar.idf_plus_one = on;
1450 SELECT smlar('{199,199,199,199,1}', '{199,1}'::int4[]);
1456 SELECT t, smlar(v, '{10,9,8,7,6,5,4,3,2,1}') AS s FROM test_int4 WHERE v % '{10,9,8,7,6,5,4,3,2,1}' ORDER BY s DESC, t;
1542 SELECT t, smlar(v, '{50,49,8,7,6,5,4,33,2,1}') AS s FROM test_int4 WHERE v % '{50,49,8,7,6,5,4,33,2,1}' ORDER BY s DESC, t;
1632 RESET enable_seqscan;