Re: [PATCH] Incremental sort (was: PoC: Partial sort)

From: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>
To: James Coleman <jtc331(at)gmail(dot)com>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, Rafia Sabih <rafia(dot)pghackers(at)gmail(dot)com>, Peter Geoghegan <pg(at)bowt(dot)ie>, Simon Riggs <simon(at)2ndquadrant(dot)com>, Shaun Thomas <shaun(dot)thomas(at)2ndquadrant(dot)com>, Dmitry Dolgov <9erthalion6(at)gmail(dot)com>, Alexander Korotkov <a(dot)korotkov(at)postgrespro(dot)ru>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Subject: Re: [PATCH] Incremental sort (was: PoC: Partial sort)
Date: 2020-03-21 00:56:40
Message-ID: 20200321005640.vrwcpyis6ahmspwt@development
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


I've looked at v38 but it seems it's a bit broken by some recent explain
changes (mostly missing type in declarations). Attached is v39 fixing
those issues, and including a bunch of fixes based on a review - most of
the changes is in comments, so I've instead kept them in separate "fix"
patches after each part.

In general I'm mostly happy with the current shape of the patch, and
unless there are some objections I'd like to get some of it committed
sometime next week.

I've done a fair amount of testing with various queries, and the plan
changes seem pretty sensible. I'm still not entirely sure whether to be
a bit conservative and only tweak the first patch adding incremental
sort to extra places, or commit both.

The main thing I still have on my plate is assessment of how much more
expensive can the planning due to increased number of paths we
generate/keep (due to considering extra pathkeys). I haven't seen any
significant slowdowns, but I plan to look at some extreme cases (many
similar and applicable indexes etc.).


Tomas Vondra
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachment Content-Type Size
v39-0001-Consider-low-startup-cost-when-adding-partial-path.patch text/plain 3.2 KB
v39-0002-fix-comments.patch text/plain 2.2 KB
v39-0003-Implement-incremental-sort.patch text/plain 154.1 KB
v39-0004-fix.patch text/plain 6.9 KB
v39-0005-Consider-incremental-sort-paths-in-additional-places.patch text/plain 13.0 KB
v39-0006-fix.patch text/plain 6.0 KB
v39-0007-A-couple-more-places-for-incremental-sort.patch text/plain 9.3 KB
v39-0008-fix.patch text/plain 2.1 KB

In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2020-03-21 02:55:22 Re: color by default
Previous Message Justin Pryzby 2020-03-20 23:03:18 Re: Add A Glossary