1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-24 14:22:24 +03:00
Files
config
contrib
adminpack
amcheck
auth_delay
auto_explain
bloom
bool_plperl
btree_gin
btree_gist
data
expected
bit.out
bytea.out
cash.out
char.out
char_1.out
cidr.out
date.out
enum.out
float4.out
float8.out
inet.out
init.out
int2.out
int4.out
int8.out
interval.out
macaddr.out
macaddr8.out
not_equal.out
numeric.out
oid.out
text.out
text_1.out
time.out
timestamp.out
timestamptz.out
timetz.out
uuid.out
varbit.out
varchar.out
varchar_1.out
sql
.gitignore
Makefile
btree_bit.c
btree_bytea.c
btree_cash.c
btree_date.c
btree_enum.c
btree_float4.c
btree_float8.c
btree_gist--1.0--1.1.sql
btree_gist--1.1--1.2.sql
btree_gist--1.2--1.3.sql
btree_gist--1.2.sql
btree_gist--1.3--1.4.sql
btree_gist--1.4--1.5.sql
btree_gist--1.5--1.6.sql
btree_gist.c
btree_gist.control
btree_gist.h
btree_inet.c
btree_int2.c
btree_int4.c
btree_int8.c
btree_interval.c
btree_macaddr.c
btree_macaddr8.c
btree_numeric.c
btree_oid.c
btree_text.c
btree_time.c
btree_ts.c
btree_utils_num.c
btree_utils_num.h
btree_utils_var.c
btree_utils_var.h
btree_uuid.c
citext
cube
dblink
dict_int
dict_xsyn
earthdistance
file_fdw
fuzzystrmatch
hstore
hstore_plperl
hstore_plpython
intagg
intarray
isn
jsonb_plperl
jsonb_plpython
lo
ltree
ltree_plpython
oid2name
old_snapshot
pageinspect
passwordcheck
pg_buffercache
pg_freespacemap
pg_prewarm
pg_stat_statements
pg_surgery
pg_trgm
pg_visibility
pgcrypto
pgrowlocks
pgstattuple
postgres_fdw
seg
sepgsql
spi
sslinfo
start-scripts
tablefunc
tcn
test_decoding
tsm_system_rows
tsm_system_time
unaccent
uuid-ossp
vacuumlo
xml2
Makefile
README
contrib-global.mk
doc
src
.dir-locals.el
.editorconfig
.git-blame-ignore-revs
.gitattributes
.gitignore
COPYRIGHT
GNUmakefile.in
HISTORY
Makefile
README
README.git
aclocal.m4
configure
configure.ac
postgres/contrib/btree_gist/expected/timestamp.out
Heikki Linnakangas d92b1cdbab Revert "Add sortsupport for gist_btree opclasses, for faster index builds."
This reverts commit 9f984ba6d2.

It was making the buildfarm unhappy, apparently setting client_min_messages
in a regression test produces different output if log_statement='all'.
Another issue is that I now suspect the bit sortsupport function was in
fact not correct to call byteacmp(). Revert to investigate both of those
issues.
2021-04-07 14:33:21 +03:00

92 lines
2.5 KiB
Plaintext

-- timestamp check
CREATE TABLE timestamptmp (a timestamp);
\copy timestamptmp from 'data/timestamp.data'
SET enable_seqscan=on;
SELECT count(*) FROM timestamptmp WHERE a < '2004-10-26 08:55:08';
count
-------
278
(1 row)
SELECT count(*) FROM timestamptmp WHERE a <= '2004-10-26 08:55:08';
count
-------
279
(1 row)
SELECT count(*) FROM timestamptmp WHERE a = '2004-10-26 08:55:08';
count
-------
1
(1 row)
SELECT count(*) FROM timestamptmp WHERE a >= '2004-10-26 08:55:08';
count
-------
290
(1 row)
SELECT count(*) FROM timestamptmp WHERE a > '2004-10-26 08:55:08';
count
-------
289
(1 row)
SELECT a, a <-> '2004-10-26 08:55:08' FROM timestamptmp ORDER BY a <-> '2004-10-26 08:55:08' LIMIT 3;
a | ?column?
--------------------------+------------------------------------
Tue Oct 26 08:55:08 2004 | @ 0
Sun Oct 31 06:35:03 2004 | @ 4 days 21 hours 39 mins 55 secs
Mon Nov 29 20:12:43 2004 | @ 34 days 11 hours 17 mins 35 secs
(3 rows)
CREATE INDEX timestampidx ON timestamptmp USING gist ( a );
SET enable_seqscan=off;
SELECT count(*) FROM timestamptmp WHERE a < '2004-10-26 08:55:08'::timestamp;
count
-------
278
(1 row)
SELECT count(*) FROM timestamptmp WHERE a <= '2004-10-26 08:55:08'::timestamp;
count
-------
279
(1 row)
SELECT count(*) FROM timestamptmp WHERE a = '2004-10-26 08:55:08'::timestamp;
count
-------
1
(1 row)
SELECT count(*) FROM timestamptmp WHERE a >= '2004-10-26 08:55:08'::timestamp;
count
-------
290
(1 row)
SELECT count(*) FROM timestamptmp WHERE a > '2004-10-26 08:55:08'::timestamp;
count
-------
289
(1 row)
EXPLAIN (COSTS OFF)
SELECT a, a <-> '2004-10-26 08:55:08' FROM timestamptmp ORDER BY a <-> '2004-10-26 08:55:08' LIMIT 3;
QUERY PLAN
-----------------------------------------------------------------------------------
Limit
-> Index Only Scan using timestampidx on timestamptmp
Order By: (a <-> 'Tue Oct 26 08:55:08 2004'::timestamp without time zone)
(3 rows)
SELECT a, a <-> '2004-10-26 08:55:08' FROM timestamptmp ORDER BY a <-> '2004-10-26 08:55:08' LIMIT 3;
a | ?column?
--------------------------+------------------------------------
Tue Oct 26 08:55:08 2004 | @ 0
Sun Oct 31 06:35:03 2004 | @ 4 days 21 hours 39 mins 55 secs
Mon Nov 29 20:12:43 2004 | @ 34 days 11 hours 17 mins 35 secs
(3 rows)