Re: Indexes and inheritance

From: Alan Hodgson <ahodgson(at)simkin(dot)ca>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: Indexes and inheritance
Date: 2006-03-24 19:26:08
Message-ID: 200603241126.08223@hal.medialogik.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On March 24, 2006 11:06 am, "Pierre Thibaudeau" <pierdeux(at)gmail(dot)com> wrote:
> Ah, thank you.
>
> So I suppose, the new index on the daughter is akin to a partial index on
> the mother, although one that couldn't be used while searching the
> mother...

It will be used while searching column A on the parent table, which by
default will descend to child tables. Well, in effect, 2 different
queries will be performed, and their results merged. You should use
"explain" and "explain analyze" to understand how your queries will
execute, especially in inheritance situations.

You might also read the 8.1 documentation on partitioning if you desire
different behaviour, ie. how to create CHECK constraints that will control
which child tables are examined for particular queries of the parent, which
would effect more of the partial index behaviour.

--
They laughed at Columbus, they laughed at Fulton, they laughed at the
Wright brothers. But they also laughed at Bozo the Clown." -- Carl Sagan

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message John DeSoi 2006-03-25 13:47:28 Re: Bytea and perl
Previous Message Pierre Thibaudeau 2006-03-24 19:06:14 Re: Indexes and inheritance