Re: Indexes and inheritance - Mailing list pgsql-novice

From Alan Hodgson
Subject Re: Indexes and inheritance
Date
Msg-id 200603241126.08223@hal.medialogik.com
Whole thread Raw
In response to Re: Indexes and inheritance  ("Pierre Thibaudeau" <pierdeux@gmail.com>)
List pgsql-novice
On March 24, 2006 11:06 am, "Pierre Thibaudeau" <pierdeux@gmail.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


pgsql-novice by date:

Previous
From: "Pierre Thibaudeau"
Date:
Subject: Re: Indexes and inheritance
Next
From: John DeSoi
Date:
Subject: Re: Bytea and perl