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

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

From: Claudio Freire <klaussfreire(at)gmail(dot)com>
To: Alessandro Gagliardi <alessandro(at)path(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Why should such a simple query over indexed columns be so slow?
Date: 2012-01-30 20:59:10
Message-ID: CAGTBQpZ9Udxu58bv-mHTEjR=3eqVSXgeX4Gbh9KpUQGyDkZd=g@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-performance
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

> My effective_cache_size is 1530000kB

Um... barring some really bizarre GUC setting, I cannot imagine how it
could be preferring the sequential scan.
Maybe some of the more knowedgeable folks has a hint.

In the meanwhile, you can use the seqscan stuff on that query alone.
Be sure to use it on that query alone - ie, re-enable it afterwards,
or discard the connection.

In response to

Responses

pgsql-performance by date

Next:From: Fernando HeviaDate: 2012-01-30 21:13:19
Subject: Re: Why should such a simple query over indexed columns be so slow?
Previous:From: Alessandro GagliardiDate: 2012-01-30 20:55:18
Subject: Re: Why should such a simple query over indexed columns be so slow?

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