Re: Why should such a simple query over indexed columns be so slow? - Mailing list pgsql-performance

From Josh Berkus
Subject Re: Why should such a simple query over indexed columns be so slow?
Date
Msg-id 4F270AB1.6070100@agliodbs.com
Whole thread Raw
In response to Re: Why should such a simple query over indexed columns be so slow?  (Claudio Freire <klaussfreire@gmail.com>)
Responses Re: Why should such a simple query over indexed columns be so slow?
List pgsql-performance
On 1/30/12 12:59 PM, Claudio Freire wrote:
> On Mon, Jan 30, 2012 at 5:55 PM, Alessandro Gagliardi
> <alessandro@path.com> wrote:
>> Hm. Well, it looks like setting enable_seqscan=false is session specific, so
>> it seems like I can use it with this query alone; but it sounds like even if
>> that works, it's a bad practice. (Is that true?)
>
> Yep

The issue with that is that the enable_seqscan setting is not limited to
that one table in that query, and won't change over time.  So by all
means use it as a hotfix right now, but it's not a long-term solution to
your problem.

>
>> My effective_cache_size is 1530000kB

That seems appropriate for the Ronin; I'll test one out and see what
random_page_cost is set to as well, possibly Heroku needs to adjust the
basic template for the Ronin.  For Heroku, we want to favor index scans
a bit more than you would on regular hardware because the underlying
storage is Amazon, which has good seeks but crap throughput.

You can do "SHOW random_page_cost" yourself right now, too.

--
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com

pgsql-performance by date:

Previous
From: Fernando Hevia
Date:
Subject: Re: Why should such a simple query over indexed columns be so slow?
Next
From: Alessandro Gagliardi
Date:
Subject: Re: Why should such a simple query over indexed columns be so slow?