pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Robert Haas <robertmhaas@gmail.com>
To: Joseph Shraibman <jks@selectacast.net>
Cc: pgsql-performance@postgresql.org <pgsql-performance@postgresql.org>
Subject: Re: index usage on queries on inherited tables
Date: Sat, 30 Apr 2011 00:53:48 +0200
Message-ID: <B4595D4D-13FE-4B75-B5E0-12D340AEECAC@gmail.com> (raw)
In-Reply-To: <4DB88690.5050701@selectacast.net>
References: <in36ut$24hs$1@news.hub.org>
	<BANLkTi=g=dA7Bt_P=m0Amknp9r-k6x5-Sw@mail.gmail.com>
	<4DB88690.5050701@selectacast.net>

On Apr 27, 2011, at 11:11 PM, Joseph Shraibman <jks@selectacast.net> wrote:
> On 04/27/2011 04:32 PM, Robert Haas wrote:
>> In the first case, PostgreSQL evidently thinks that using the indexes
>> will be slower than just ignoring them.  You could find out whether
>> it's right by trying it with enable_seqscan=off.
> 
> My point is that this is just a problem with inherited tables.  It
> should be obvious to postgres that few rows are being returned, but in
> the inherited tables case it doesn't use indexes.  This was just an
> example.  In a 52 gig table I have a "select id from table limit 1 order
> by id desc" returns instantly, but as soon as you declare a child table
> it tries to seq scan all the tables.

Oh, sorry, I must have misunderstood. As Greg says, this is fixed in 9.1.

...Robert



view thread (6+ messages)

Message-ID: <B4595D4D-13FE-4B75-B5E0-12D340AEECAC@gmail.com>
Permalink:  ../B4595D4D-13FE-4B75-B5E0-12D340AEECAC@gmail.com/
Also on:    postgresql.org/message-id/B4595D4D-13FE-4B75-B5E0-12D340AEECAC@gmail.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: robertmhaas@gmail.com, jks@selectacast.net
  Subject: Re: index usage on queries on inherited tables
  In-Reply-To: <B4595D4D-13FE-4B75-B5E0-12D340AEECAC@gmail.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