mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-12-21 08:29:39 +08:00
67 lines
1.1 KiB
Plaintext
67 lines
1.1 KiB
Plaintext
-- money check
|
|
CREATE TABLE moneytmp (a money) WITH OIDS;
|
|
\copy moneytmp from 'data/cash.data'
|
|
SET enable_seqscan=on;
|
|
SELECT count(*) FROM moneytmp WHERE a < '22649.64';
|
|
count
|
|
-------
|
|
289
|
|
(1 row)
|
|
|
|
SELECT count(*) FROM moneytmp WHERE a <= '22649.64';
|
|
count
|
|
-------
|
|
290
|
|
(1 row)
|
|
|
|
SELECT count(*) FROM moneytmp WHERE a = '22649.64';
|
|
count
|
|
-------
|
|
1
|
|
(1 row)
|
|
|
|
SELECT count(*) FROM moneytmp WHERE a >= '22649.64';
|
|
count
|
|
-------
|
|
254
|
|
(1 row)
|
|
|
|
SELECT count(*) FROM moneytmp WHERE a > '22649.64';
|
|
count
|
|
-------
|
|
253
|
|
(1 row)
|
|
|
|
CREATE INDEX moneyidx ON moneytmp USING gist ( a );
|
|
SET enable_seqscan=off;
|
|
SELECT count(*) FROM moneytmp WHERE a < '22649.64'::money;
|
|
count
|
|
-------
|
|
289
|
|
(1 row)
|
|
|
|
SELECT count(*) FROM moneytmp WHERE a <= '22649.64'::money;
|
|
count
|
|
-------
|
|
290
|
|
(1 row)
|
|
|
|
SELECT count(*) FROM moneytmp WHERE a = '22649.64'::money;
|
|
count
|
|
-------
|
|
1
|
|
(1 row)
|
|
|
|
SELECT count(*) FROM moneytmp WHERE a >= '22649.64'::money;
|
|
count
|
|
-------
|
|
254
|
|
(1 row)
|
|
|
|
SELECT count(*) FROM moneytmp WHERE a > '22649.64'::money;
|
|
count
|
|
-------
|
|
253
|
|
(1 row)
|
|
|