Re: Clustered index when not always in the WHERE clause

From: Brian Ghidinelli <brian(at)pukkasoft(dot)com>
To: SF Postgres <sfpug(at)postgresql(dot)org>
Subject: Re: Clustered index when not always in the WHERE clause
Date: 2010-10-29 21:05:36
Message-ID: 4CCB3720.9030402@pukkasoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: sfpug


On 10/29/2010 1:36 PM, Josh Berkus wrote:
> Is the same event_id value shared by more than on club_id? If so, then
> clustering won't benefit you at all for event_id queries.

Jeff and Josh, thanks for the replies. Sorry I didn't clarify this in
the original post but event_ids are unique to club_id.

Jeff Davis wrote:
> - an event is only associated with one club (event_id determines
> club_id)
> - the combination of event and type is unique, but event is not
> unique by itself (is this true?)

event_id does not need type to be unique actually; in this particular
table 'where event_id = x' would be enough to return the right rows for
our purposes.

Sounds like the clustered index on (club_id, event_id) will get the job
done? Thanks!

Brian

In response to

Browse sfpug by date

  From Date Subject
Next Message Richard Broersma 2010-10-29 23:03:59 Call For Talks: PGDay LA @ SCALE 9X
Previous Message Josh Berkus 2010-10-29 20:36:45 Re: Clustered index when not always in the WHERE clause