mirror of
https://github.com/postgres/postgres.git
synced 2025-06-17 17:02:08 +03:00
config
contrib
adminpack
amcheck
auth_delay
auto_explain
basebackup_to_shell
basic_archive
bloom
bool_plperl
btree_gin
btree_gist
data
expected
bit.out
bool.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_bool.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--1.6--1.7.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
pg_walinspect
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
.cirrus.yml
.dir-locals.el
.editorconfig
.git-blame-ignore-revs
.gitattributes
.gitignore
COPYRIGHT
GNUmakefile.in
HISTORY
Makefile
README
README.git
aclocal.m4
configure
configure.ac
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.
208 lines
3.2 KiB
Plaintext
208 lines
3.2 KiB
Plaintext
-- numeric check
|
|
CREATE TABLE numerictmp (a numeric);
|
|
\copy numerictmp from 'data/int8.data'
|
|
\copy numerictmp from 'data/numeric.data'
|
|
\copy numerictmp from 'data/float8.data'
|
|
SET enable_seqscan=on;
|
|
SELECT count(*) FROM numerictmp WHERE a < -1890.0;
|
|
count
|
|
-------
|
|
505
|
|
(1 row)
|
|
|
|
SELECT count(*) FROM numerictmp WHERE a <= -1890.0;
|
|
count
|
|
-------
|
|
506
|
|
(1 row)
|
|
|
|
SELECT count(*) FROM numerictmp WHERE a = -1890.0;
|
|
count
|
|
-------
|
|
1
|
|
(1 row)
|
|
|
|
SELECT count(*) FROM numerictmp WHERE a >= -1890.0;
|
|
count
|
|
-------
|
|
597
|
|
(1 row)
|
|
|
|
SELECT count(*) FROM numerictmp WHERE a > -1890.0;
|
|
count
|
|
-------
|
|
596
|
|
(1 row)
|
|
|
|
SELECT count(*) FROM numerictmp WHERE a < 'NaN' ;
|
|
count
|
|
-------
|
|
1100
|
|
(1 row)
|
|
|
|
SELECT count(*) FROM numerictmp WHERE a <= 'NaN' ;
|
|
count
|
|
-------
|
|
1102
|
|
(1 row)
|
|
|
|
SELECT count(*) FROM numerictmp WHERE a = 'NaN' ;
|
|
count
|
|
-------
|
|
2
|
|
(1 row)
|
|
|
|
SELECT count(*) FROM numerictmp WHERE a >= 'NaN' ;
|
|
count
|
|
-------
|
|
2
|
|
(1 row)
|
|
|
|
SELECT count(*) FROM numerictmp WHERE a > 'NaN' ;
|
|
count
|
|
-------
|
|
0
|
|
(1 row)
|
|
|
|
SELECT count(*) FROM numerictmp WHERE a < 0 ;
|
|
count
|
|
-------
|
|
523
|
|
(1 row)
|
|
|
|
SELECT count(*) FROM numerictmp WHERE a <= 0 ;
|
|
count
|
|
-------
|
|
526
|
|
(1 row)
|
|
|
|
SELECT count(*) FROM numerictmp WHERE a = 0 ;
|
|
count
|
|
-------
|
|
3
|
|
(1 row)
|
|
|
|
SELECT count(*) FROM numerictmp WHERE a >= 0 ;
|
|
count
|
|
-------
|
|
579
|
|
(1 row)
|
|
|
|
SELECT count(*) FROM numerictmp WHERE a > 0 ;
|
|
count
|
|
-------
|
|
576
|
|
(1 row)
|
|
|
|
CREATE INDEX numericidx ON numerictmp USING gist ( a );
|
|
SET enable_seqscan=off;
|
|
SELECT count(*) FROM numerictmp WHERE a < -1890.0;
|
|
count
|
|
-------
|
|
505
|
|
(1 row)
|
|
|
|
SELECT count(*) FROM numerictmp WHERE a <= -1890.0;
|
|
count
|
|
-------
|
|
506
|
|
(1 row)
|
|
|
|
SELECT count(*) FROM numerictmp WHERE a = -1890.0;
|
|
count
|
|
-------
|
|
1
|
|
(1 row)
|
|
|
|
SELECT count(*) FROM numerictmp WHERE a >= -1890.0;
|
|
count
|
|
-------
|
|
597
|
|
(1 row)
|
|
|
|
SELECT count(*) FROM numerictmp WHERE a > -1890.0;
|
|
count
|
|
-------
|
|
596
|
|
(1 row)
|
|
|
|
SELECT count(*) FROM numerictmp WHERE a < 'NaN' ;
|
|
count
|
|
-------
|
|
1100
|
|
(1 row)
|
|
|
|
SELECT count(*) FROM numerictmp WHERE a <= 'NaN' ;
|
|
count
|
|
-------
|
|
1102
|
|
(1 row)
|
|
|
|
SELECT count(*) FROM numerictmp WHERE a = 'NaN' ;
|
|
count
|
|
-------
|
|
2
|
|
(1 row)
|
|
|
|
SELECT count(*) FROM numerictmp WHERE a >= 'NaN' ;
|
|
count
|
|
-------
|
|
2
|
|
(1 row)
|
|
|
|
SELECT count(*) FROM numerictmp WHERE a > 'NaN' ;
|
|
count
|
|
-------
|
|
0
|
|
(1 row)
|
|
|
|
SELECT count(*) FROM numerictmp WHERE a < 0 ;
|
|
count
|
|
-------
|
|
523
|
|
(1 row)
|
|
|
|
SELECT count(*) FROM numerictmp WHERE a <= 0 ;
|
|
count
|
|
-------
|
|
526
|
|
(1 row)
|
|
|
|
SELECT count(*) FROM numerictmp WHERE a = 0 ;
|
|
count
|
|
-------
|
|
3
|
|
(1 row)
|
|
|
|
SELECT count(*) FROM numerictmp WHERE a >= 0 ;
|
|
count
|
|
-------
|
|
579
|
|
(1 row)
|
|
|
|
SELECT count(*) FROM numerictmp WHERE a > 0 ;
|
|
count
|
|
-------
|
|
576
|
|
(1 row)
|
|
|
|
-- Test index-only scans
|
|
SET enable_bitmapscan=off;
|
|
EXPLAIN (COSTS OFF)
|
|
SELECT * FROM numerictmp WHERE a BETWEEN 1 AND 300 ORDER BY a;
|
|
QUERY PLAN
|
|
---------------------------------------------------------------------
|
|
Sort
|
|
Sort Key: a
|
|
-> Index Only Scan using numericidx on numerictmp
|
|
Index Cond: ((a >= '1'::numeric) AND (a <= '300'::numeric))
|
|
(4 rows)
|
|
|
|
SELECT * FROM numerictmp WHERE a BETWEEN 1 AND 300 ORDER BY a;
|
|
a
|
|
------------
|
|
204.035430
|
|
207.400532
|
|
(2 rows)
|
|
|