Precheck to consider path costs for partial paths

Started by Nikita Malakhovalmost 2 years ago2 messageshackers
Jump to latest
#1Nikita Malakhov
hukutoc@gmail.com

Hi hackers!

I'd stumbled upon the discussion [1]/messages/by-id/SEZPR06MB649422CDEBEBBA3915154EE58A232@SEZPR06MB6494.apcprd06.prod.outlook.com on TPC-DS query performance,
looked into code that caused this behavior and saw that partial hash,
merge and nested loop paths are discarded regardless of costs
if they have more pathkeys.

I've excluded the pathkey chain length condition from the precheck function
and added passing precalculated startup cost in addition to total cost,
and it seems to produce a more effective plan for case in [1]/messages/by-id/SEZPR06MB649422CDEBEBBA3915154EE58A232@SEZPR06MB6494.apcprd06.prod.outlook.com.

Please check the attached patch. I'm very interested if my assumption
is correct or not.

[1]: /messages/by-id/SEZPR06MB649422CDEBEBBA3915154EE58A232@SEZPR06MB6494.apcprd06.prod.outlook.com
/messages/by-id/SEZPR06MB649422CDEBEBBA3915154EE58A232@SEZPR06MB6494.apcprd06.prod.outlook.com

--
Regards,
Nikita Malakhov
Postgres Professional
The Russian Postgres Company
https://postgrespro.ru/

Attachments:

t50670_1
v1-0001-ppath-precheck.patchapplication/octet-stream; name=v1-0001-ppath-precheck.patchDownload+8-12
#2Andreas Karlsson
andreas.karlsson@percona.com
In reply to: Nikita Malakhov (#1)
Re: Precheck to consider path costs for partial paths

On 12/3/24 7:24 PM, Nikita Malakhov wrote:

Please check the attached patch. I'm very interested if my assumption
is correct or not.

Hi,

You probably attached the wrong file since your patch does not even compile.

Andreas