mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-12-21 08:29:39 +08:00
3f11971916
at end of files.
32 lines
763 B
SQL
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;
|