postgresql/contrib/btree_gist/sql/date.sql
2010-08-19 05:57:36 +00:00

32 lines
763 B
SQL

-- date check
CREATE TABLE datetmp (a date);
\copy datetmp from 'data/date.data'
SET enable_seqscan=on;
SELECT count(*) FROM datetmp WHERE a < '2001-02-13';
SELECT count(*) FROM datetmp WHERE a <= '2001-02-13';
SELECT count(*) FROM datetmp WHERE a = '2001-02-13';
SELECT count(*) FROM datetmp WHERE a >= '2001-02-13';
SELECT count(*) FROM datetmp WHERE a > '2001-02-13';
CREATE INDEX dateidx ON datetmp USING gist ( a );
SET enable_seqscan=off;
SELECT count(*) FROM datetmp WHERE a < '2001-02-13'::date;
SELECT count(*) FROM datetmp WHERE a <= '2001-02-13'::date;
SELECT count(*) FROM datetmp WHERE a = '2001-02-13'::date;
SELECT count(*) FROM datetmp WHERE a >= '2001-02-13'::date;
SELECT count(*) FROM datetmp WHERE a > '2001-02-13'::date;