BTW, I slightly modify your test to provide more stable results.
--
Teodor Sigaev E-mail: [email protected]
WWW: http://www.sigaev.ru/
drop table test;
CREATE TABLE test (box box);
alter table test set (autovacuum_enabled=off);
insert into test (select box(point(x, x),point(x, x))
from generate_series(1,5000000) as x);
vacuum test;
CREATE INDEX test_idx ON test USING gist (box);
SET enable_seqscan TO false;
SET enable_bitmapscan TO false;
SET enable_indexscan TO true;
SET enable_indexonlyscan TO true;
select count(box) from test where box && box(point(0,0),
point(1000000,1000000));
delete from test where box && box(point(0,0), point(1000000,1000000));
-- This query invokes gistkillitems()
select count(box) from test where box && box(point(0,0),
point(1000000,1000000));
-- These queries should work faster with microvacuum
select count(box) from test where box && box(point(0,0),
point(1000000,1000000));
select count(box) from test where box && box(point(0,0),
point(1000000,1000000));
select count(box) from test where box && box(point(0,0),
point(1000000,1000000));
--
Sent via pgsql-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers