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

From: Alessandro Gagliardi <alessandro(at)path(dot)com>
To: Claudio Freire <klaussfreire(at)gmail(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:55:18
Message-ID: CAAB3BBJrSUeU+b0cpYH7O9nPVPN5yoEvEGPYtJAm1vFbFpe9EQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

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?)

My effective_cache_size is 1530000kB

On Mon, Jan 30, 2012 at 12:50 PM, Claudio Freire <klaussfreire(at)gmail(dot)com>wrote:

> On Mon, Jan 30, 2012 at 5:35 PM, Alessandro Gagliardi
> <alessandro(at)path(dot)com> wrote:
> > To answer your (non-)question about Heroku, it's a cloud service, so I
> don't
> > host PostgreSQL myself. I'm not sure how much I can mess with things like
> > GUC since I don't even have access to the "postgres" database on the
> server.
> > I am a long time SQL user but new to Postgres so I welcome suggestions on
> > where to start with that sort of thing. Setting enable_seqscan=false
> made a
> > huge difference, so I think I'll start there.
>
> It's not a good idea to abuse of the enable_stuff settings, they're
> for debugging, not for general use. In particular, disable sequential
> scans everywhere can have a disastrous effect on performance.
>
> It sounds as if PG had a misconfigured effective_cache_size. What does
> "show effective_cache_size" tell you?
>

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Claudio Freire 2012-01-30 20:59:10 Re: Why should such a simple query over indexed columns be so slow?
Previous Message Claudio Freire 2012-01-30 20:50:21 Re: Why should such a simple query over indexed columns be so slow?