MergeAppend could consider sorting cheapest child path - Mailing list pgsql-hackers

From Alexander Pyhalov
Subject MergeAppend could consider sorting cheapest child path
Date
Msg-id 25d6a2cd161673d51373b7e07e6d9dd6@postgrespro.ru
Whole thread Raw
List pgsql-hackers
Hi.

Now when planner finds suitable pathkeys in 
generate_orderedappend_paths(), it uses them, even if explicit sort of 
the cheapest child path could be more efficient.

We encountered this issue on partitioned table with two indexes, where 
one is suitable for sorting, and another is good for selecting data. 
MergeAppend was generated
with subpaths doing index scan on suitably ordered index and filtering a 
lot of data.
The suggested fix allows MergeAppend to consider sorting on cheapest 
childrel total path as an alternative.

-- 
Best regards,
Alexander Pyhalov,
Postgres Professional
Attachment

pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: PostgreSQL 17 Beta 2 release date & commit freeze
Next
From: Laurenz Albe
Date:
Subject: Re: Reducing the log spam