Re: Index on multiple columns VS multiple index

From: "Jonathan S(dot) Katz" <jonathan(dot)katz(at)excoventures(dot)com>
To: Brice André <brice(at)famille-andre(dot)be>
Cc: "pgsql-sql(at)postgresql(dot)org" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Index on multiple columns VS multiple index
Date: 2014-01-02 20:06:28
Message-ID: B8172ABC-0EB4-4859-8D93-A7CB11DA6785@excoventures.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Jan 2, 2014, at 3:00 PM, Brice André wrote:

> But I have still one question that remains :
>
> suppose I define an index on ('a', 'b') columns, will it be useful for a search on 'a' column only, or will it be ignore by postgresl ?

If you define the index on ('a', 'b') in that order and are just searching for 'a' in your query, the query planner will use the index.

Jonathan

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Brice André 2014-01-02 20:12:51 Re: Index on multiple columns VS multiple index
Previous Message Jonathan S. Katz 2014-01-02 20:05:11 Re: Index on multiple columns VS multiple index