Re: Make the qual cost on index Filter slightly higher than qual cost on index Cond.

From: Andy Fan <zhihui(dot)fan1213(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, Ashutosh Bapat <ashutosh(dot)bapat(at)2ndquadrant(dot)com>, Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Make the qual cost on index Filter slightly higher than qual cost on index Cond.
Date: 2020-05-29 14:11:52
Message-ID: CAKU4AWqe+L-Lm0srM7qPkygPknYCscv-RiG=pO8_XnUjqYRrrA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> The other serious error we could be making here is to change things on
>> the basis of just a few examples. You really need a pretty wide range
>> of test cases to be sure that you're not making things worse, any time
>> you're twiddling basic parameters like these.
>>
>>
> I will try more thing with this direction, thanks for suggestion.
>

I choose TPC-H for this purpose and the data and index setup based on [1],
the attached normal.log is the plan without this patch, and patched.log is
the
plan with the patch. In general, the best path doesn't change due to this
patch,
All the plans whose cost changed has the following patten, which is
expected.

Index Scan ...
Index Cond: ...
Filter: ...

If you diff the two file, you may find the cost of "Index Scan" doesn't
change,
that is mainly because it only show 2 digits in cost, which is not accurate
enough
to show the difference. However with a nest loop, the overall plan shows
the cost
difference.

[1] https://ankane.org/tpc-h

--
Best Regards
Andy Fan

Attachment Content-Type Size
normal.log application/octet-stream 50.4 KB
patched.log application/octet-stream 50.4 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2020-05-29 14:21:00 proposal: possibility to read dumped table's name from file
Previous Message Andy Fan 2020-05-29 13:58:49 Re: Make the qual cost on index Filter slightly higher than qual cost on index Cond.