Re: Why should such a simple query over indexed columns be so slow?

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: Why should such a simple query over indexed columns be so slow?
Date: 2012-01-30 21:25:05
Message-ID: 4F270AB1.6070100@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On 1/30/12 12:59 PM, Claudio Freire wrote:
> On Mon, Jan 30, 2012 at 5:55 PM, Alessandro Gagliardi
> <alessandro(at)path(dot)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

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Alessandro Gagliardi 2012-01-30 21:39:14 Re: Why should such a simple query over indexed columns be so slow?
Previous Message Fernando Hevia 2012-01-30 21:13:19 Re: Why should such a simple query over indexed columns be so slow?