Re: Linking tables and indexes

From: Jorge Godoy <jgodoy(at)gmail(dot)com>
To: Jorge Godoy <jgodoy(at)gmail(dot)com>
Cc: PostgreSQL General ML <pgsql-general(at)postgresql(dot)org>
Subject: Re: Linking tables and indexes
Date: 2007-01-16 02:46:56
Message-ID: 87ac0jit7j.fsf@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Alvaro Herrera <alvherre(at)commandprompt(dot)com> writes:

> If you're in 8.1 or better, I'd suggest defining only two indexes, one

I'm on 8.1. Waiting for SuSE to update to 8.2... ;-)

> on (ci_id) and other on (document_client_id), and let the system deal
> with mixing them using the bitmap scan technique when appropriate.

I thought about that but then I'd loose the UNIQUE constraint on this set.
I've also thought about creating a third index to specify the UNIQUE
constraint but ...

> OTOH since the columns are probably not separately unique, you'll need
> the primary key anyway, in which case leave the PK alone and create
> another index on (document_client_id).

... I haven't thought on this and it is much better :-) I played with some
possibilities and I forgot mixing a composed index with a simple one... :-)

This is what I went with. Thanks!

--
Jorge Godoy <jgodoy(at)gmail(dot)com>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jorge Godoy 2007-01-16 02:48:49 Re: Improve Postgres Query Speed
Previous Message carter ck 2007-01-16 02:26:15 Re: Improve Postgres Query Speed