From: | Ernesto Quiñones <ernestoq(at)gmail(dot)com> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Two indexes on same column |
Date: | 2012-01-10 16:30:36 |
Message-ID: | CAMB2kH60A5Gf_63jDi7d2hq1e2hiPgNMKt6frvp+TL_Te2Uysg@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Hi, I was reading about indexes and I have a question:
is possible to use "hash" like index method in primary key constraints??
thanks
2011/7/20 Raghavendra <raghavendra(dot)rao(at)enterprisedb(dot)com>:
>
> On Wed, Jul 20, 2011 at 2:39 PM, Vlastimil Krejcir <krejcir(at)ics(dot)muni(dot)cz>
> wrote:
>>
>> Hi,
>>
>> what index is used (and according to what rules) when there are two (or
>> more) different indexes defined on one column? Assume:
>>
>> CREATE TABLE example (
>> id SERIAL PRIMARY KEY,
>> ...);
>> CREATE INDEX example_id_idx ON example USING hash (id);
>>
>> By default there are btree index created and the hash index is then
>> created. So there are two indexes on column "id". Are there described
>> somewhere what index is used and when? Does it depend on query analyzer and
>> planner?
>>
>> Thanks
>>
>
> You are right, depends on the optimizer and query to which index to choose.
> EXPLAIN command on the query will give you the optimizer path.
>
> ---
> Regards,
> Raghavendra
> EnterpriseDB Corporation
> Blog: http://raghavt.blogspot.com/
>
>
--
----------------------------------------------------------
Visita : http://www.eqsoft.net
----------------------------------------------------------
Sigueme en Twitter : http://www.twitter.com/ernestoq
From | Date | Subject | |
---|---|---|---|
Next Message | Andy Colson | 2012-01-10 16:33:27 | Re: string = any() |
Previous Message | David Johnston | 2012-01-10 16:28:39 | Re: string = any() |