Index on multiple columns VS multiple index

From: Brice André <brice(at)famille-andre(dot)be>
To: "pgsql-sql(at)postgresql(dot)org" <pgsql-sql(at)postgresql(dot)org>
Subject: Index on multiple columns VS multiple index
Date: 2014-01-02 19:17:46
Message-ID: CAOBG12m10zcGwHY_g8+Mwhs2sXjBvue5EqidHGj+pZtH3XFCXw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hello everyone,

I have a question concerning index : suppose I have a table with fields 'a'
and 'b' and that all requests perform WHERE clauses on 'a' field, and some
requests also perform WHERE clauses on 'b' fields. What is the best
approach for indexing strategy:

- One index on 'a' and one on 'b'
- One index on both columns 'a' and 'b'
- A combination of both solutions ?

Thanks in advance,

Brice

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Jonathan S. Katz 2014-01-02 19:22:59 Re: Index on multiple columns VS multiple index
Previous Message Achilleas Mantzios 2013-12-18 08:45:37 Re: Query caching (with 8.3)