MergeAppend could consider sorting cheapest child path
Alexander Pyhalov <a.pyhalov@postgrespro.ru>
From: Alexander Pyhalov <a.pyhalov@postgrespro.ru>
To: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2024-06-18T16:45:09Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Mostly-cosmetic adjustments to estimate_multivariate_bucketsize().
- aadf7db66ef5 19 (unreleased) cited
-
Consider fractional paths in generate_orderedappend_paths
- 6b94e7a6da2f 15.0 cited
Attachments
- v1-0001-MergeAppend-could-consider-using-sorted-best-path.patch (text/x-diff) patch v1-0001
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