New version. Add support for int2, int8, float4, float8, timestamp with/without time zone, time with/without time zone, date, interval, oid, money and macaddr, char, varchar/text, bytea, numeric, bit, varbit, inet/cidr types for GiST
2004-05-28 10:43:32 +00:00
|
|
|
-- cidr check
|
|
|
|
|
|
|
|
CREATE TABLE cidrtmp AS
|
|
|
|
SELECT cidr(a) AS a FROM inettmp ;
|
|
|
|
|
|
|
|
SET enable_seqscan=on;
|
|
|
|
|
|
|
|
SELECT count(*) FROM cidrtmp WHERE a < '121.111.63.82';
|
|
|
|
|
|
|
|
SELECT count(*) FROM cidrtmp WHERE a <= '121.111.63.82';
|
|
|
|
|
|
|
|
SELECT count(*) FROM cidrtmp WHERE a = '121.111.63.82';
|
|
|
|
|
|
|
|
SELECT count(*) FROM cidrtmp WHERE a >= '121.111.63.82';
|
|
|
|
|
|
|
|
SELECT count(*) FROM cidrtmp WHERE a > '121.111.63.82';
|
|
|
|
|
2021-04-07 13:22:05 +03:00
|
|
|
SET client_min_messages = DEBUG1;
|
New version. Add support for int2, int8, float4, float8, timestamp with/without time zone, time with/without time zone, date, interval, oid, money and macaddr, char, varchar/text, bytea, numeric, bit, varbit, inet/cidr types for GiST
2004-05-28 10:43:32 +00:00
|
|
|
CREATE INDEX cidridx ON cidrtmp USING gist ( a );
|
2021-04-07 13:22:05 +03:00
|
|
|
CREATE INDEX cidridx_b ON cidrtmp USING gist ( a ) WITH (buffering=on);
|
|
|
|
DROP INDEX cidridx_b;
|
|
|
|
RESET client_min_messages;
|
New version. Add support for int2, int8, float4, float8, timestamp with/without time zone, time with/without time zone, date, interval, oid, money and macaddr, char, varchar/text, bytea, numeric, bit, varbit, inet/cidr types for GiST
2004-05-28 10:43:32 +00:00
|
|
|
|
|
|
|
SET enable_seqscan=off;
|
|
|
|
|
|
|
|
SELECT count(*) FROM cidrtmp WHERE a < '121.111.63.82'::cidr;
|
|
|
|
|
|
|
|
SELECT count(*) FROM cidrtmp WHERE a <= '121.111.63.82'::cidr;
|
|
|
|
|
|
|
|
SELECT count(*) FROM cidrtmp WHERE a = '121.111.63.82'::cidr;
|
|
|
|
|
|
|
|
SELECT count(*) FROM cidrtmp WHERE a >= '121.111.63.82'::cidr;
|
|
|
|
|
|
|
|
SELECT count(*) FROM cidrtmp WHERE a > '121.111.63.82'::cidr;
|