mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-08-30 02:27:19 +02:00
33 lines
764 B
MySQL
33 lines
764 B
MySQL
|
-- 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;
|
||
|
|