Re: Question on indexes - Mailing list pgsql-general

From Greg Sabino Mullane
Subject Re: Question on indexes
Date
Msg-id CAKAnmmKORn7S+Nc6Pr1y57hV2G833F6QyM9vhdFeoAZmTmdnSw@mail.gmail.com
Whole thread Raw
In response to Re: Question on indexes  (Durgamahesh Manne <maheshpostgres9@gmail.com>)
Responses Re: Question on indexes
List pgsql-general
(please start a new thread in the future rather than replying to an existing one)

You cannot query on b and use an index on (a,b) as you observed. However, you can have two indexes:

index1(a)
index2(b)

Postgres will be able to combine those when needed in the case where your WHERE clause needs to filter by both columns. So then you no longer need the two-column index.

Cheers,
Greg


pgsql-general by date:

Previous
From: Durgamahesh Manne
Date:
Subject: Re: Question on indexes
Next
From: iseki
Date:
Subject: Re: Questions about document "Concurrenry control" section