Re: Query in 9.0.2 not using index in 9.0.0 works fine

From: Samuel Gendler <sgendler(at)ideasculptor(dot)com>
To: Matthias Howell <Matthias(dot)Howell(at)voxco(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Query in 9.0.2 not using index in 9.0.0 works fine
Date: 2011-07-06 20:01:39
Message-ID: CAEV0TzAM44Tr-hs0FOzyayBsmoJHVUMXsjG0A-UqALxjug1o5g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Wed, Jul 6, 2011 at 5:50 AM, Matthias Howell
<Matthias(dot)Howell(at)voxco(dot)com>wrote:

>
>
> However, in the end, it was user brain damage.****
>
> ** **
>
> It does use the doc id index for the subquery, but for some reason, the
> primary key on sentences - the sentenceid - was not set. So in fact, there
> is no index.****
>
> ** **
>
> Machines vindicated once again.****
>

For the record, if you follow the instructions for submitting slow query
questions, we'd likely have spotted it very quickly if you hadn't spotted it
yourself while doing the cut and paste. The instructions ask for table
definitions, so you'd likely have noticed the missing index when you copied
those into your email. The link (
http://wiki.postgresql.org/wiki/SlowQueryQuestions ) is right there on the
mailing list page at postgresql.org. It's always a toss-up whether to
attempt to answer a question like yours or just respond with a link to that
page when the relevant info is missing ;-)

--sam

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Scott Marlowe 2011-07-06 21:05:58 Re: 100% CPU Utilization when we run queries.
Previous Message Tomas Vondra 2011-07-06 19:04:13 Re: 100% CPU Utilization when we run queries.