Inefficient use of index scan on 2nd column of composite index during concurrent activity

From: Durgamahesh Manne <maheshpostgres9(at)gmail(dot)com>
To: pgsql-in-general(at)postgresql(dot)org
Subject: Inefficient use of index scan on 2nd column of composite index during concurrent activity
Date: 2024-10-07 04:31:00
Message-ID: CAJCZkoL3E5M7taGpdtJRhwM0zCQ1-T2uzv4FKj_Arrz-fRusOQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-in-general

Hi team

Second column of composite index not in use effectively with index scan
when using second column at where clause

I have composite index on (placedon,id) of test
When quering select * from test where id = '4234';
Value of id changes and during concurrent activity and cpu utilization
increased toomuch that i have observed which means query plan changed why

I could see index scan with explain for it

Is there any way to keep index scan for it during even on concurrency
rather than seperate index on second column of composite index ?

Hope everyone understand this

Regards,
Durga Mahesh

Responses

Browse pgsql-general by date

  From Date Subject
Next Message KK CHN 2024-10-07 11:30:47 Re: CLOSE_WAIT pileup and Application Timeout
Previous Message Adrian Klaver 2024-10-06 20:27:30 Re: Question on pg_stat* views

Browse pgsql-in-general by date

  From Date Subject
Next Message Durgamahesh Manne 2024-10-11 13:31:50 Fwd: Inefficient use of index scan on 2nd column of composite index during concurrent activity
Previous Message Durgamahesh Manne 2024-09-29 04:13:44 Re: Synchronize the dump with a logical slot with --snapshot