mirror of
https://github.com/hanzoai/postgres.git
synced 2026-10-30 18:33:07 +00:00
Using the just-added infrastructure, extend btree_gin to support cross-type operators in its other opclasses. All of the cross-type comparison operators supported by the core btree opclasses for these datatypes are now available for btree_gin indexes as well. Author: Tom Lane <[email protected]> Reviewed-by: Arseniy Mukhin <[email protected]> Discussion: https://postgr.es/m/[email protected]
25 lines
822 B
SQL
25 lines
822 B
SQL
set enable_seqscan=off;
|
|
|
|
CREATE TABLE test_float8 (
|
|
i float8
|
|
);
|
|
|
|
INSERT INTO test_float8 VALUES (-2),(-1),(0),(1),(2),(3);
|
|
|
|
CREATE INDEX idx_float8 ON test_float8 USING gin (i);
|
|
|
|
SELECT * FROM test_float8 WHERE i<1::float8 ORDER BY i;
|
|
SELECT * FROM test_float8 WHERE i<=1::float8 ORDER BY i;
|
|
SELECT * FROM test_float8 WHERE i=1::float8 ORDER BY i;
|
|
SELECT * FROM test_float8 WHERE i>=1::float8 ORDER BY i;
|
|
SELECT * FROM test_float8 WHERE i>1::float8 ORDER BY i;
|
|
|
|
explain (costs off)
|
|
SELECT * FROM test_float8 WHERE i<1::float4 ORDER BY i;
|
|
|
|
SELECT * FROM test_float8 WHERE i<1::float4 ORDER BY i;
|
|
SELECT * FROM test_float8 WHERE i<=1::float4 ORDER BY i;
|
|
SELECT * FROM test_float8 WHERE i=1::float4 ORDER BY i;
|
|
SELECT * FROM test_float8 WHERE i>=1::float4 ORDER BY i;
|
|
SELECT * FROM test_float8 WHERE i>1::float4 ORDER BY i;
|