Should I create an index for partition with fixed key?

From: Sergey Samokhin <prikrutil(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Should I create an index for partition with fixed key?
Date: 2009-09-02 19:53:09
Message-ID: e42595410909021253l60c4bc0aneaf3dd395926a371@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello.

Some days ago I started using partitioning to make it possible to work
with large amount of data.

I created master table as documentation suggest, created some child
tables which inherit from the master one and then added a constraint
for each child table to define the allowed key value. Constraint was
like:

CHECK (site_id = 'google_com')

Now here is my question:

While reading the documentation I came across the following
suggestion: "For each partition, create an index on the key column(s)"

Should I do that if the key will be the same for the whole partition?
Will there be any benefits of having an index on site_id column?

When I first read it, I decided that if all rows have the same key
(say site_id = 'google_com') then there is no need in index.

Thanks.

--
Sergey Samokhin

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Merlin Moncure 2009-09-02 20:08:21 Re: binary format of array stored as text
Previous Message Dave Huber 2009-09-02 19:50:44 binary format of array stored as text