1 set extra_float_digits =0;
2 SELECT set_smlar_limit(0.6);
8 epoch2timestamp(v)::timestamptz::timetz
10 generate_series(1, t) as v
14 generate_series(1, 200) as t;
17 SELECT t, smlar(v, to_tsp_array('{10,9,8,7,6,5,4,3,2,1}')::timestamptz[]::timetz[]) AS s FROM test_timetz WHERE v % to_tsp_array('{10,9,8,7,6,5,4,3,2,1}')::timestamptz[]::timetz[] ORDER BY s DESC, t;
18 SELECT t, smlar(v, to_tsp_array('{50,49,8,7,6,5,4,33,2,1}')::timestamptz[]::timetz[]) AS s FROM test_timetz WHERE v % to_tsp_array('{50,49,8,7,6,5,4,33,2,1}')::timestamptz[]::timetz[] ORDER BY s DESC, t;
20 CREATE INDEX idx_test_timetz ON test_timetz USING gist (v _timetz_sml_ops);
22 SET enable_seqscan=off;
24 SELECT t, smlar(v, to_tsp_array('{10,9,8,7,6,5,4,3,2,1}')::timestamptz[]::timetz[]) AS s FROM test_timetz WHERE v % to_tsp_array('{10,9,8,7,6,5,4,3,2,1}')::timestamptz[]::timetz[] ORDER BY s DESC, t;
25 SELECT t, smlar(v, to_tsp_array('{50,49,8,7,6,5,4,33,2,1}')::timestamptz[]::timetz[]) AS s FROM test_timetz WHERE v % to_tsp_array('{50,49,8,7,6,5,4,33,2,1}')::timestamptz[]::timetz[] ORDER BY s DESC, t;
27 DROP INDEX idx_test_timetz;
28 CREATE INDEX idx_test_timetz ON test_timetz USING gin (v _timetz_sml_ops);
30 SELECT t, smlar(v, to_tsp_array('{10,9,8,7,6,5,4,3,2,1}')::timestamptz[]::timetz[]) AS s FROM test_timetz WHERE v % to_tsp_array('{10,9,8,7,6,5,4,3,2,1}')::timestamptz[]::timetz[] ORDER BY s DESC, t;
31 SELECT t, smlar(v, to_tsp_array('{50,49,8,7,6,5,4,33,2,1}')::timestamptz[]::timetz[]) AS s FROM test_timetz WHERE v % to_tsp_array('{50,49,8,7,6,5,4,33,2,1}')::timestamptz[]::timetz[] ORDER BY s DESC, t;
33 SET enable_seqscan=on;