pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Joseph Shraibman <jks@selectacast.net>
To: Robert Haas <robertmhaas@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: index usage on queries on inherited tables
Date: Wed, 27 Apr 2011 17:11:44 -0400
Message-ID: <4DB88690.5050701@selectacast.net> (raw)
In-Reply-To: <BANLkTi=g=dA7Bt_P=m0Amknp9r-k6x5-Sw@mail.gmail.com>
References: <in36ut$24hs$1@news.hub.org>
	<BANLkTi=g=dA7Bt_P=m0Amknp9r-k6x5-Sw@mail.gmail.com>

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.



view thread (6+ messages)  latest in thread

Message-ID: <4DB88690.5050701@selectacast.net>
Permalink:  ../4DB88690.5050701@selectacast.net/
Also on:    postgresql.org/message-id/4DB88690.5050701@selectacast.net

 · 

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: jks@selectacast.net, robertmhaas@gmail.com
  Subject: Re: index usage on queries on inherited tables
  In-Reply-To: <4DB88690.5050701@selectacast.net>

* 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