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

Re: index usage on queries on inherited tables

From: Joseph Shraibman <jks(at)selectacast(dot)net>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: index usage on queries on inherited tables
Date: 2011-04-27 21:11:44
Message-ID: 4DB88690.5050701@selectacast.net (view raw or flat)
Thread:
Lists: pgsql-performance
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.

In response to

Responses

pgsql-performance by date

Next:From: Greg SmithDate: 2011-04-27 21:55:36
Subject: Re: Performance
Previous:From: Claudio FreireDate: 2011-04-27 21:01:46
Subject: Re: Performance

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