- Notifications
You must be signed in to change notification settings - Fork 59
/
Copy pathint2.sql
23 lines (17 loc) · 758 Bytes
/
int2.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
set enable_seqscan=off;
CREATETABLEtest_int2 (
i int2
);
INSERT INTO test_int2 VALUES (-2),(-1),(0),(1),(2),(3);
CREATEINDEXidx_int2ON test_int2 USING rum (i);
SELECT*FROM test_int2 WHERE i<1::int2 ORDER BY i;
SELECT*FROM test_int2 WHERE i<=1::int2 ORDER BY i;
SELECT*FROM test_int2 WHERE i=1::int2 ORDER BY i;
SELECT*FROM test_int2 WHERE i>=1::int2 ORDER BY i;
SELECT*FROM test_int2 WHERE i>1::int2 ORDER BY i;
EXPLAIN (costs off)
SELECT*, i <=>0::int2 FROM test_int2 ORDER BY i <=>0::int2;
SELECT*, i <=>0::int2 FROM test_int2 ORDER BY i <=>0::int2;
EXPLAIN (costs off)
SELECT*, i <=>1::int2 FROM test_int2 WHERE i<1::int2 ORDER BY i <=>1::int2;
SELECT*, i <=>1::int2 FROM test_int2 WHERE i<1::int2 ORDER BY i <=>1::int2;