summaryrefslogtreecommitdiffstats
path: root/contrib/btree_gist/sql/oid.sql
blob: c9358234ce9f4af65a16a3cf0b8056c61d878819 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
-- oid check

SET enable_seqscan=on;

CREATE TEMPORARY TABLE oidtmp (oid oid);
INSERT INTO oidtmp SELECT g.i::oid FROM generate_series(1, 1000) g(i);

SELECT count(*) FROM oidtmp WHERE oid <  17;

SELECT count(*) FROM oidtmp WHERE oid <= 17;

SELECT count(*) FROM oidtmp WHERE oid  = 17;

SELECT count(*) FROM oidtmp WHERE oid >= 17;

SELECT count(*) FROM oidtmp WHERE oid >  17;

CREATE INDEX oididx ON oidtmp USING gist ( oid );

SET enable_seqscan=off;

SELECT count(*) FROM oidtmp WHERE oid <  17;

SELECT count(*) FROM oidtmp WHERE oid <= 17;

SELECT count(*) FROM oidtmp WHERE oid  = 17;

SELECT count(*) FROM oidtmp WHERE oid >= 17;

SELECT count(*) FROM oidtmp WHERE oid >  17;