Re: Question on indexes - Mailing list pgsql-general

From Durgamahesh Manne
Subject Re: Question on indexes
Date
Msg-id CAJCZkoKAhQ2VC-eA4zWgxfW5nTAA2N4V5vrsWFXHPVvVg0WdfQ@mail.gmail.com
Whole thread Raw
In response to Re: Question on indexes  (Greg Sabino Mullane <htamfids@gmail.com>)
List pgsql-general


On Fri, Oct 11, 2024 at 6:18 PM Greg Sabino Mullane <htamfids@gmail.com> wrote:
(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

 
Hi greg 

Mail sent you with a new thread. composite key is on partitioned table 

Regards,
Durga Mahesh  

pgsql-general by date:

Previous
From: Durgamahesh Manne
Date:
Subject: Fwd: Inefficient use of index scan on 2nd column of composite index during concurrent activity
Next
From: Erik Wienhold
Date:
Subject: Re: Questions about document "Concurrenry control" section