pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephen Byers <stephenabyers@yahoo.com>
To: Steinar H. Gunderson <sgunderson@bigfoot.com>
To: pgsql-performance@postgresql.org
Subject: Re: why is bitmap index chosen for this query?
Date: Thu, 18 May 2006 12:53:16 -0700 (PDT)
Message-ID: <20060518195316.38327.qmail@web30709.mail.mud.yahoo.com> (raw)
In-Reply-To: <20060518194813.GA8539@uio.no>

Yes, here are the runtimes for the repeated query.
  Total runtime: 748716.750 ms
Total runtime: 749170.934 ms
Total runtime: 744113.594 ms
Total runtime: 746314.251 ms
Total runtime: 742083.732 ms

  Thanks,
  Steve

"Steinar H. Gunderson" <sgunderson@bigfoot.com> wrote:
  On Thu, May 18, 2006 at 12:38:18PM -0700, Stephen Byers wrote:
> I repeated explain analyze on the query 5 times and it came up with the same plan.

Yes, but did it end up with the same runtime? That's the interesting part --
the plan will almost always be identical between explain analyze runs given
that you haven't done anything in between them.

> You asked about index order and physical table order. In general the index
> order is indeed close to the same order as the physical table order.
> However, this query is likely an exception. The data is actually from a
> backup server that has filled a hole for some of the time range that I'm
> specifying in my query.

Well, it still isn't all that far-fetched to believe that the data has lots
of correlation (which helps the index scan quite a lot) that the planner
isn't able to pick up. I don't know the details here, so I can't tell you how
the correlation for such a query (WHERE a=foo and b between bar and baz) is
estimated. Something tells me someone else might, though. :-)

/* Steinar */
-- 
Homepage: http://www.sesse.net/

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org


			
---------------------------------
Sneak preview the  all-new Yahoo.com. It's not radically different. Just radically better. 

view thread (11+ messages)  latest in thread

Message-ID: <20060518195316.38327.qmail@web30709.mail.mud.yahoo.com>
Permalink:  ../20060518195316.38327.qmail@web30709.mail.mud.yahoo.com/
Also on:    postgresql.org/message-id/20060518195316.38327.qmail@web30709.mail.mud.yahoo.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: stephenabyers@yahoo.com, sgunderson@bigfoot.com
  Subject: Re: why is bitmap index chosen for this query?
  In-Reply-To: <20060518195316.38327.qmail@web30709.mail.mud.yahoo.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox