Re: Partitioning: Planner makes no use of indexes on inherited

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Stephen Friedrich <stephen(dot)friedrich(at)fortis-it(dot)de>
Cc: Richard Huxton <dev(at)archonet(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Partitioning: Planner makes no use of indexes on inherited
Date: 2006-01-18 12:25:03
Message-ID: 20060118122503.GB27070@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Jan 18, 2006 at 11:35:27AM +0100, Stephen Friedrich wrote:
> Martijn van Oosterhout wrote:
> >The problem AFAICS is that the planner is taking the results of two
> >tables which are ordered by id and merging them. PostgreSQL doesn't
> >have a Merge node type so it does this by concatentating the lists and
> >sorting again.

<snip>

> Or wait, maybe postgres considers rows from the parent table, because
> the parent table has no check constraint. Unfortunately according to the
> doc I cannot define a check constraint on the parent table, because it
> would be inherited by the other tables.

Are you sure? I havn't tested it but the ALTER syntax allows you to say
something like:

ALTER TABLE ONLY foo ADD CONSTRAINT ...

> There are problems with even simpler queries, e.g.
> "select min(id) from call_sources where cdr_id = 10554;" is doing a
> sequential scan. Even if it considers results from the parent table it
> should
> combine the results of two index scans.

Same problem. Min/max want something sorted and the partitioning code
doesn't do that yet.

Have a nice day,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Daryl Richter 2006-01-18 12:32:53 Re: bug with if ... then ... clause in views
Previous Message Kai Hessing 2006-01-18 10:51:43 Re: Problem with restoring database from 7.3.1 to 8.0.1