Re: indexes in partitioned tables - again

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Samuel Gendler <sgendler(at)ideasculptor(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: indexes in partitioned tables - again
Date: 2010-04-07 21:13:18
Message-ID: m2m603c8f071004071413w1f2d2497hbbe07d9c6491848f@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Tue, Apr 6, 2010 at 5:37 PM, Samuel Gendler
<sgendler(at)ideasculptor(dot)com> wrote:
> In part, I'm surprised that the index scan takes as long as it does,
> since I'd think an index would be able to return the set of keys
> relatively quickly.  But that's a secondary issue.

We don't actually have a facility built into the index-scan machinery
to scan for distinct keys. It's doing a full scan of the index and
then unique-ifying the results afterward. It produces the right
answers, but it's definitely not as fast as it could be.

The planner is not as smart about partitioned tables as it could be,
either. A scan of the partitioned tables is implemented as an append
node with one member per partition; and the planner isn't very good at
pushing things down through append nodes.

...Robert

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Craig James 2010-04-07 21:37:22 Occasional giant spikes in CPU load
Previous Message Robert Haas 2010-04-07 18:39:26 Re: query slow; strace output worrisome