mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-12-27 08:39:28 +08:00
2d6b1f29fb
datatype in test, to try to avoid any dependency on local time zone.
40 lines
793 B
Plaintext
40 lines
793 B
Plaintext
--
|
|
-- first, define the datatype. Turn off echoing so that expected file
|
|
-- does not depend on contents of seg.sql.
|
|
--
|
|
\set ECHO none
|
|
create table inttmp (b int4);
|
|
\copy inttmp from 'data/test_btree.data'
|
|
create table tstmp ( t timestamp without time zone );
|
|
\copy tstmp from 'data/test_btree_ts.data'
|
|
-- without idx
|
|
select count(*) from inttmp where b <=10;
|
|
count
|
|
-------
|
|
11
|
|
(1 row)
|
|
|
|
select count(*) from tstmp where t < '2001-05-29 08:33:09';
|
|
count
|
|
-------
|
|
66
|
|
(1 row)
|
|
|
|
-- create idx
|
|
create index aaaidx on inttmp using gist ( b );
|
|
create index tsidx on tstmp using gist ( t );
|
|
--with idx
|
|
set enable_seqscan=off;
|
|
select count(*) from inttmp where b <=10;
|
|
count
|
|
-------
|
|
11
|
|
(1 row)
|
|
|
|
select count(*) from tstmp where t < '2001-05-29 08:33:09';
|
|
count
|
|
-------
|
|
66
|
|
(1 row)
|
|
|