public inbox for [email protected]  
help / color / mirror / Atom feed
From: Laurenz Albe <[email protected]>
To: yudhi s <[email protected]>
Cc: Ron Johnson <[email protected]>
Cc: Adrian Klaver <[email protected]>
Cc: Nisarg Patel <[email protected]>
Cc: pgsql-general <[email protected]>
Subject: Re: Question on execution plan and suitable index
Date: Mon, 16 Feb 2026 12:52:20 +0100
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAEzWdqdo14MgxC_XO+ah_7r-cyEJwfenSAyve1tAeLaE+nwLZA@mail.gmail.com>
References: <CAEzWdqeGj9FcubNXegJ8PGTnXNahUhgc6T+yNFW7O12EkKR9yA@mail.gmail.com>
	<[email protected]>
	<CAEzWdqfxtEzxO10Rnr0Yw+tPJMtCuu2c2e1mr6bEzuYL1U1BvA@mail.gmail.com>
	<[email protected]>
	<CAEzWdqdo14MgxC_XO+ah_7r-cyEJwfenSAyve1tAeLaE+nwLZA@mail.gmail.com>

On Mon, 2026-02-16 at 16:09 +0530, yudhi s wrote:
> I have updated the plan below. While trying to replace actual binds and
> the objects with sample names some lines got missed initially it seems.
> 
> https://gist.github.com/databasetech0073/f564ac23ee35d1f0413980fe4d00efa9 

Thanks.

Does the filter on "due_date" eliminate many rows in "orders"?  If yes,
and an index on that column would actually perform better (which you
could test with enable_seqscan = off), perhaps your "random_page_cost"
parameter is set too high.

Where you can certainly make a difference is the repeated scan on
"event_audit_log".  An index on (request_id, event_comment_text, created_at)
should speed up that part.

Yours,
Laurenz Albe






view thread (7+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: Question on execution plan and suitable index
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox