1 set extra_float_digits =0;
2 SELECT set_smlar_limit(0.6);
8 CREATE TYPE cint AS (id int, w float4);
13 (ROW(v::int4, v::float4))::cint
15 generate_series(1, t) as v
17 INTO test_composite_int4
19 generate_series(1, 200) as t;
20 SELECT t, smlar(v, '{"(10,1)", "(9,1)", "(8,1)", "(7,1)", "(6,1)", "(5,1)", "(4,1)", "(3,1)", "(2,1)", "(1,1)"}'::cint[]) AS s
21 FROM test_composite_int4
22 WHERE v % '{"(10,1)", "(9,1)", "(8,1)", "(7,1)", "(6,1)", "(5,1)", "(4,1)", "(3,1)", "(2,1)", "(1,1)"}'::cint[] ORDER BY s DESC, t;
51 SELECT t, smlar(v, '{"(50,1)", "(49,1)", "(8,1)", "(7,1)", "(6,1)", "(5,1)", "(4,1)", "(33,1)", "(2,1)", "(1,1)"}'::cint[] AS s
52 FROM test_composite_int4
53 WHERE v % '{"(50,1)", "(49,1)", "(8,1)", "(7,1)", "(6,1)", "(5,1)", "(4,1)", "(33,1)", "(2,1)", "(1,1)"}'::cint[]) ORDER BY s DESC, t;
54 ERROR: syntax error at or near "AS"
55 LINE 1: ..."(5,1)", "(4,1)", "(33,1)", "(2,1)", "(1,1)"}'::cint[] AS s
57 SELECT t, smlar(v, '{"(10,1)", "(9,1)", "(8,1)", "(7,1)", "(6,1)", "(5,1)", "(4,1)", "(3,1)", "(2,1)", "(1,1)"}'::cint[]) AS s
58 FROM test_composite_int4
59 WHERE smlar(v, '{"(10,1)", "(9,1)", "(8,1)", "(7,1)", "(6,1)", "(5,1)", "(4,1)", "(3,1)", "(2,1)", "(1,1)"}'::cint[]) > 0.6 ORDER BY s DESC, t;
88 SELECT t, smlar(v, '{"(50,1)", "(49,1)", "(8,1)", "(7,1)", "(6,1)", "(5,1)", "(4,1)", "(33,1)", "(2,1)", "(1,1)"}'::cint[]) AS s
89 FROM test_composite_int4
90 WHERE smlar(v, '{"(50,1)", "(49,1)", "(8,1)", "(7,1)", "(6,1)", "(5,1)", "(4,1)", "(33,1)", "(2,1)", "(1,1)"}'::cint[]) > 0.6 ORDER BY s DESC, t;
103 SELECT t, smlar(v, '{"(10,1)", "(9,1)", "(8,1)", "(7,1)", "(6,1)", "(5,1)", "(4,1)", "(3,1)", "(2,1)", "(1,1)"}'::cint[], false) AS s
104 FROM test_composite_int4
105 WHERE smlar(v, '{"(10,1)", "(9,1)", "(8,1)", "(7,1)", "(6,1)", "(5,1)", "(4,1)", "(3,1)", "(2,1)", "(1,1)"}'::cint[], false) > 0.6 ORDER BY s DESC, t;
119 SELECT t, smlar(v, '{"(50,1)", "(49,1)", "(8,1)", "(7,1)", "(6,1)", "(5,1)", "(4,1)", "(33,1)", "(2,1)", "(1,1)"}'::cint[], false) AS s
120 FROM test_composite_int4
121 WHERE smlar(v, '{"(50,1)", "(49,1)", "(8,1)", "(7,1)", "(6,1)", "(5,1)", "(4,1)", "(33,1)", "(2,1)", "(1,1)"}'::cint[], false) > 0.6 ORDER BY s DESC, t;
129 SELECT t, smlar(v, '{"(10,1)", "(9,1)", "(8,1)", "(7,1)", "(6,1)", "(5,1)", "(4,1)", "(3,1)", "(2,1)", "(1,1)"}'::cint[], true) AS s
130 FROM test_composite_int4
131 WHERE smlar(v, '{"(10,1)", "(9,1)", "(8,1)", "(7,1)", "(6,1)", "(5,1)", "(4,1)", "(3,1)", "(2,1)", "(1,1)"}'::cint[], true) > 0.6 ORDER BY s DESC, t;
336 SELECT t, smlar(v, '{"(50,1)", "(49,1)", "(8,1)", "(7,1)", "(6,1)", "(5,1)", "(4,1)", "(33,1)", "(2,1)", "(1,1)"}'::cint[], true) AS s
337 FROM test_composite_int4
338 WHERE smlar(v, '{"(50,1)", "(49,1)", "(8,1)", "(7,1)", "(6,1)", "(5,1)", "(4,1)", "(33,1)", "(2,1)", "(1,1)"}'::cint[], true) > 0.6 ORDER BY s DESC, t;