Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Performance > Re: switchover ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 3 Topic 4151 of 4352
Post > Topic >>

Re: switchover between index and sequential scans

by stark@[EMAIL PROTECTED] (Gregory Stark) Jul 3, 2008 at 11:05 AM

"Abhijit Menon-Sen" <ams@[EMAIL PROTECTED]
> writes:

>          ->  Index Scan using header_fields_message_key on header_fields
 (cost=0.00..1126.73 rows=325 width=4) (actual time=9.003..12.330 rows=17
loops=75)
>                Index Cond: (header_fields.message = "outer".message)
>
>          ->  Seq Scan on header_fields  (cost=0.00..85706.78
rows=1811778 width=4) (actual time=22.505..29281.553 rows=1812184 loops=1)

It looks to me like it's overestimating the number of rows in the index
scan
by 20x and it's overestimating the cost of random accesses by about 100%.
Combined it's overestimating the cost of the index scan by about 40x.

> This machine has only 512MB of RAM, and is running FreeBSD 5.4. It has
> shared_buffers=3072, effective_cache_size=25000, work_mem=sort_mem=2048.
> Changing the last two doesn't seem to have any effect on the plan.

You could try dramatically increasing effective_cache_size to try to
convince
it that most of the random accesses are cached. Or you could reach for the
bigger hammer and reduce random_page_cost by about half.

Also, if this box is dedicated you could make use of more than 24M for
shared
buffers. Probably something in the region 64M-128M if your database is
large
enough to warrant it.

And increase the statistics target on header_fields and re-analyze?

-- 
  Gregory Stark
  EnterpriseDB          http://www.enterprisedb.com
  Ask me about EnterpriseDB's RemoteDBA services!

-- 
Sent via pgsql-performance mailing list (pgsql-performance@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance
 




 3 Posts in Topic:
switchover between index and sequential scans
ams@[EMAIL PROTECTED] (A  2008-07-03 13:29:00 
Re: switchover between index and sequential scans
stark@[EMAIL PROTECTED]   2008-07-03 11:05:46 
Re: switchover between index and sequential scans
ams@[EMAIL PROTECTED] (A  2008-07-03 17:15:50 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Oct 12 9:15:38 CDT 2008.