Re: PostgreSQL Choosing Full Index Over Partial Index - Mailing list pgsql-performance

From Tom Lane
Subject Re: PostgreSQL Choosing Full Index Over Partial Index
Date
Msg-id 1287724.1746022444@sss.pgh.pa.us
Whole thread Raw
In response to Re: PostgreSQL Choosing Full Index Over Partial Index  (Felipe López Montes <xocas89@gmail.com>)
List pgsql-performance
=?UTF-8?Q?Felipe_L=C3=B3pez_Montes?= <xocas89@gmail.com> 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



pgsql-performance by date:

Previous
From: Felipe López Montes
Date:
Subject: Re: PostgreSQL Choosing Full Index Over Partial Index
Next
From: Leo
Date:
Subject: Vacuum Questions