mirror of
https://github.com/postgres/postgres.git
synced 2025-10-25 13:17:41 +03:00
R-tree is dead ... long live GiST.
This commit is contained in:
@@ -67,42 +67,6 @@ CREATE INDEX onek2_u2_prtl ON onek2 USING btree(unique2 int4_ops)
|
||||
CREATE INDEX onek2_stu1_prtl ON onek2 USING btree(stringu1 name_ops)
|
||||
where onek2.stringu1 >= 'J' and onek2.stringu1 < 'K';
|
||||
|
||||
--
|
||||
-- RTREE
|
||||
--
|
||||
-- rtrees use a quadratic page-splitting algorithm that takes a
|
||||
-- really, really long time. we don't test all rtree opclasses
|
||||
-- in the regression test (we check them using the sequoia 2000
|
||||
-- benchmark).
|
||||
--
|
||||
CREATE INDEX rect2ind ON fast_emp4000 USING rtree (home_base);
|
||||
|
||||
SET enable_seqscan = ON;
|
||||
SET enable_indexscan = OFF;
|
||||
SET enable_bitmapscan = OFF;
|
||||
|
||||
SELECT * FROM fast_emp4000
|
||||
WHERE home_base @ '(200,200),(2000,1000)'::box
|
||||
ORDER BY home_base USING <;
|
||||
|
||||
SELECT count(*) FROM fast_emp4000 WHERE home_base && '(1000,1000,0,0)'::box;
|
||||
|
||||
SET enable_seqscan = OFF;
|
||||
SET enable_indexscan = ON;
|
||||
SET enable_bitmapscan = ON;
|
||||
|
||||
-- there's no easy way to check that these commands actually use
|
||||
-- the index, unfortunately. (EXPLAIN would work, but its output
|
||||
-- changes too often for me to want to put an EXPLAIN in the test...)
|
||||
SELECT * FROM fast_emp4000
|
||||
WHERE home_base @ '(200,200),(2000,1000)'::box
|
||||
ORDER BY home_base USING <;
|
||||
|
||||
SELECT count(*) FROM fast_emp4000 WHERE home_base && '(1000,1000,0,0)'::box;
|
||||
|
||||
DROP INDEX rect2ind;
|
||||
|
||||
|
||||
--
|
||||
-- GiST (rtree-equivalent opclasses only)
|
||||
--
|
||||
|
||||
Reference in New Issue
Block a user