Re: Postgres not willing to use an index?

From: Grzegorz Jaśkiewicz <gryzman(at)gmail(dot)com>
To: Mario Splivalo <mario(dot)splivalo(at)megafon(dot)hr>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Postgres not willing to use an index?
Date: 2009-02-06 15:55:03
Message-ID: 2f4958ff0902060755x2fbd81b3u5c7f4b1d49f133ad@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Fri, Feb 6, 2009 at 3:43 PM, Mario Splivalo
<mario(dot)splivalo(at)megafon(dot)hr> wrote:

> Besides PK and uq-constraint indices I have this index:
>
> CREATE INDEX transactions_idx__client_data ON transactions
> USING btree (transaction_client_id, transaction_destination_id,
> transaction_operator_id, transaction_application_id,
> transaction_time_commit)

I think it is because it isn't just a simple index, and for some
reason planner decides - that going through every
transaction_application_id, etc, etc just to find right
transaction_time_commit isn't worth the hassle.
Try using few more indexes, on less columns.
Also, if I may - I don't think it is quite usefull to have column
names that include table name in every single one of them, makes
things so much less readable.

--
GJ

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message justin 2009-02-06 16:05:42 Re: suggestions for postgresql setup on Dell 2950 , PERC6i controller
Previous Message Mario Splivalo 2009-02-06 15:43:52 Postgres not willing to use an index?