pg.ddx.io pgsql-performance@postgresql.org mailing list archive
help / color / mirror / Atom feed From: Josh Berkus <josh@agliodbs.com>
To: pgsql-performance@postgresql.org
Subject: Re: Why should such a simple query over indexed columns be so slow?
Date: Mon, 30 Jan 2012 13:25:05 -0800
Message-ID: <4F270AB1.6070100@agliodbs.com> (raw )
In-Reply-To: <CAGTBQpZ9Udxu58bv-mHTEjR=3eqVSXgeX4Gbh9KpUQGyDkZd=g@mail.gmail.com >
References: <CAAB3BBLmzQvP0rREYJveHo=3OO8zOJJ7eL7pW5StuZKe9kVC-g@mail.gmail.com >
<CAGTBQpb-R3XvWqVN4-3FhS5zO+tsC9e9WLHmpm9GDAzuDYT+LA@mail.gmail.com >
<CAAB3BBLcBnuz+Domkvkmw5acDys9+cwWNi+8CNorjUd02WJMNw@mail.gmail.com >
<CAGTBQpYkABcva8=PzXyzRFqxMKjsXhXfZT-k2tsLh61h-aLsAw@mail.gmail.com >
<CAAB3BBJrSUeU+b0cpYH7O9nPVPN5yoEvEGPYtJAm1vFbFpe9EQ@mail.gmail.com >
<CAGTBQpZ9Udxu58bv-mHTEjR=3eqVSXgeX4Gbh9KpUQGyDkZd=g@mail.gmail.com >
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
view thread (16+ messages) latest in thread
Message-ID: <4F270AB1.6070100@agliodbs.com>
Permalink: ../4F270AB1.6070100@agliodbs.com/
Also on: postgresql.org/message-id/4F270AB1.6070100@agliodbs.com
copy link · copy postgr.es
reply Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: josh@agliodbs.com
Subject: Re: Why should such a simple query over indexed columns be so slow?
In-Reply-To: <4F270AB1.6070100@agliodbs.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox