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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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

Browse pgsql-performance by date

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