mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-12-21 08:29:39 +08:00
67 lines
1.1 KiB
Plaintext
67 lines
1.1 KiB
Plaintext
-- inet check
|
|
CREATE TABLE inettmp (a inet);
|
|
\copy inettmp from 'data/inet.data'
|
|
SET enable_seqscan=on;
|
|
SELECT count(*) FROM inettmp WHERE a < '89.225.196.191';
|
|
count
|
|
-------
|
|
213
|
|
(1 row)
|
|
|
|
SELECT count(*) FROM inettmp WHERE a <= '89.225.196.191';
|
|
count
|
|
-------
|
|
214
|
|
(1 row)
|
|
|
|
SELECT count(*) FROM inettmp WHERE a = '89.225.196.191';
|
|
count
|
|
-------
|
|
1
|
|
(1 row)
|
|
|
|
SELECT count(*) FROM inettmp WHERE a >= '89.225.196.191';
|
|
count
|
|
-------
|
|
387
|
|
(1 row)
|
|
|
|
SELECT count(*) FROM inettmp WHERE a > '89.225.196.191';
|
|
count
|
|
-------
|
|
386
|
|
(1 row)
|
|
|
|
CREATE INDEX inetidx ON inettmp USING gist ( a );
|
|
SET enable_seqscan=off;
|
|
SELECT count(*) FROM inettmp WHERE a < '89.225.196.191'::inet;
|
|
count
|
|
-------
|
|
213
|
|
(1 row)
|
|
|
|
SELECT count(*) FROM inettmp WHERE a <= '89.225.196.191'::inet;
|
|
count
|
|
-------
|
|
214
|
|
(1 row)
|
|
|
|
SELECT count(*) FROM inettmp WHERE a = '89.225.196.191'::inet;
|
|
count
|
|
-------
|
|
1
|
|
(1 row)
|
|
|
|
SELECT count(*) FROM inettmp WHERE a >= '89.225.196.191'::inet;
|
|
count
|
|
-------
|
|
387
|
|
(1 row)
|
|
|
|
SELECT count(*) FROM inettmp WHERE a > '89.225.196.191'::inet;
|
|
count
|
|
-------
|
|
386
|
|
(1 row)
|
|
|