Skip site navigation (1) Skip section navigation (2)

Re: Query much faster with enable_seqscan=0

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Greg Smith <greg(at)2ndquadrant(dot)com>
Cc: jd(at)commandprompt(dot)com, Ogden <lists(at)darkstatic(dot)com>, Jesper Krogh <jesper(at)krogh(dot)cc>, Kenneth Marshall <ktm(at)rice(dot)edu>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Query much faster with enable_seqscan=0
Date: 2010-09-21 23:24:47
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-performance
Greg Smith <greg(at)2ndquadrant(dot)com> writes:
> and the query optimizer needs to be careful about what it does and 
> doesn't pull from disk.  If that's not the case, like here where there's 
> 8GB of RAM and a 7GB database, dramatic reductions to both seq_page_cost 
> and random_page_cost can make sense.  Don't be afraid to think lowering 
> below 1.0 is going too far--something more like 0.01 for sequential and 
> 0.02 for random may actually reflect reality here.

If you are tuning for an all-in-RAM situation, you should set
random_page_cost equal to seq_page_cost (and usually set both smaller
than 1).  By definition, those costs are equal if you're fetching from
RAM.  If it's only mostly-in-RAM then keeping random_page_cost a bit
higher makes sense.

			regards, tom lane

In response to

pgsql-performance by date

Next:From: Tom LaneDate: 2010-09-21 23:30:32
Subject: Re: Query much faster with enable_seqscan=0
Previous:From: Tom LaneDate: 2010-09-21 20:44:20
Subject: Re: Auto ANALYZE criteria

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group