Re: Postgres not willing to use an index? - Mailing list pgsql-performance

From Mario Splivalo
Subject Re: Postgres not willing to use an index?
Date
Msg-id 498FF72F.3000808@megafon.hr
Whole thread Raw
In response to Re: Postgres not willing to use an index?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-performance
Tom Lane wrote:
>
> Hardly surprising --- a search on the index's lowest-order column would
> require scanning practically all of the index.  (If you think about the
> ordering of the index entries you'll see why.)  If this is a typical
> query then you need a separate index on transaction_time_commit.

Yes, actually I just moved transaction_time_commit column to the
begining of the index, since, most of the time I run queries based on
transaction_time_commit and then transaction_client_id and
transaction_destination_id.

> The fine manual goes into some detail about how to design indexes;
> http://www.postgresql.org/docs/8.3/static/indexes.html
> particularly 11.3, 11.5.

I see it now. I read the manual concerning CREATE INDEX command, and
there is no mention of multicolumn indices, did not notice Note that
points to Chapter 11.

    Mike


pgsql-performance by date:

Previous
From: Grzegorz Jaśkiewicz
Date:
Subject: Re: inheritance, and plans
Next
From: Mario Splivalo
Date:
Subject: Re: Postgres not willing to use an index?