On Tue, Feb 07, 2006 at 07:06:26AM +0100, Nemanja Corlija wrote: > On 2/7/06, Jim C. Nasby <[EMAIL PROTECTED]> wrote: > > For test 8 on PostgreSQL, what's EXPLAIN ANALYZE for one of those show? > test=# EXPLAIN ANALYZE SELECT count(*), avg(b) FROM t2 WHERE b>=0 AND b<100; > QUERY PLAN > > --------------------------------------------------------------------------------------------------------- > ------ > Aggregate (cost=6.02..6.03 rows=1 width=4) (actual time=0.183..0.185 > rows=1 loops=1) > -> Index Scan using i2b on t2 (cost=0.00..6.01 rows=1 width=4) > (actual time=0.030..0.108 rows=12 loo > ps=1) > Index Cond: ((b >= 0) AND (b < 100)) > Total runtime: 0.510 ms > (4 rows)
Well, it expected 1 row and got 12. In this example it probably doesn't matter, but for other parameters it probably will. Did you happen to do an analyze? > > What changes have you made to the default postgresql.conf? > None. Well, that certainly won't help things... at a minimum, on your machine, you should change the following: shared_buffers=10000 effective_cache_size=100000 The following should also help: work_mem=10000 vacuum_cost_delay=50 autovacuum=on autovacuum_vacuum_scale_factor=0.2 -- Jim C. Nasby, Sr. Engineering Consultant [EMAIL PROTECTED] Pervasive Software http://pervasive.com work: 512-231-6117 vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461