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

Re: Chaotically weird execution plan

From: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
To: Einars <einars(at)gmail(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Chaotically weird execution plan
Date: 2008-09-24 01:13:31
Message-ID: 48D9943B.9060801@postnewspapers.com.au (view raw or flat)
Thread:
Lists: pgsql-performance
Einars wrote:
> As query plan shows, it got the
> correct answer, 15888, very fast: the rest of the 13 seconds it's just
> rechecking all the comments for some weird reasons.

I'd already written: "If you need the test for status = 1, consider a
partial index" when I noticed your schema definition:

>     "comments_created_by" btree (created_by) WHERE status = 1

I find it hard to guess why it's having to recheck the WHERE clause
given the use of a partial index that should cover that nicely. I don't
see how it could be a visibility issue (in that I thought tuples were
read and tested for visibility as part of the initial heap scan) but I
don't see what else it could be.

It seems odd to me, so I'm really interested in seeing what others have
to say on this.

--
Craig Ringer

In response to

Responses

pgsql-performance by date

Next:From: Tom LaneDate: 2008-09-24 02:58:10
Subject: Re: Chaotically weird execution plan
Previous:From: EinarsDate: 2008-09-24 00:53:49
Subject: Chaotically weird execution plan

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