Re: Question on indexes

From: Durgamahesh Manne <maheshpostgres9(at)gmail(dot)com>
To: Greg Sabino Mullane <htamfids(at)gmail(dot)com>
Cc: sud <suds1434(at)gmail(dot)com>, Erik Wienhold <ewie(at)ewie(dot)name>, xof(at)thebuild(dot)com, pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Question on indexes
Date: 2024-10-11 13:37:30
Message-ID: CAJCZkoKAhQ2VC-eA4zWgxfW5nTAA2N4V5vrsWFXHPVvVg0WdfQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Erik Wienhold 2024-10-11 13:46:56 Re: Questions about document "Concurrenry control" section
Previous Message Durgamahesh Manne 2024-10-11 13:31:50 Fwd: Inefficient use of index scan on 2nd column of composite index during concurrent activity