public inbox for [email protected]
help / color / mirror / Atom feedFrom: Tom Lane <[email protected]>
To: Felipe López Montes <[email protected]>
Cc: [email protected]
Subject: Re: PostgreSQL Choosing Full Index Over Partial Index
Date: Wed, 30 Apr 2025 10:14:04 -0400
Message-ID: <[email protected]> (raw)
In-Reply-To: <CACJPJu8_7yFDmOLcTiVCBLRs31UB4smUtUVEeLq1GoBujqfPqQ@mail.gmail.com>
References: <CACJPJu8oY9hb7LSsqHxbn24Gpa_tWBkcwPei=fottvgBeSc+PQ@mail.gmail.com>
<[email protected]>
<[email protected]>
<CACJPJu8_7yFDmOLcTiVCBLRs31UB4smUtUVEeLq1GoBujqfPqQ@mail.gmail.com>
=?UTF-8?Q?Felipe_L=C3=B3pez_Montes?= <[email protected]> writes:
> Thanks a lot for your response Tom.
> May I ask how do you debug those functions?
> Or is it just that you read the code and more or less guess what should be
> the value for each variable with information coming from querying Postgres
> tables?
The guessing was in building a test case, since you didn't provide
a self-contained reproducer...
Once I had a case where the estimated cost was smaller for the larger
index, I just worked through the code to see where the costs diverged.
It helped that I already know the structure of that code well, but
there wasn't guesswork involved, other than where to set breakpoints
to narrow down the source more quickly.
I forgot to mention on this thread that I posted a possible fix at
[1].
regards, tom lane
[1] https://www.postgresql.org/message-id/870686.1745860834%40sss.pgh.pa.us
view thread (6+ messages)
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]
Subject: Re: PostgreSQL Choosing Full Index Over Partial 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