Re: Use generation context to speed up tuplesorts

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: David Rowley <dgrowleyml(at)gmail(dot)com>
Cc: PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Use generation context to speed up tuplesorts
Date: 2021-07-30 14:51:10
Message-ID: CA+TgmoY7ExiBjQ1M6dBCxV0uHG9TpdVXOfkJGcUAseyKPUNQHA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Jul 30, 2021 at 2:42 AM David Rowley <dgrowleyml(at)gmail(dot)com> wrote:
> Master:
> Sort Method: quicksort Memory: 5541kB
> Patched:
> Sort Method: quicksort Memory: 3197kB

Whoa.

> work_mem = '4GB';
> Test master gen sort compare
> Test1 317.2 665.6 210%
> Test2 228.6 388.9 170%
> Test3 207.4 330.7 159%
> Test4 185.5 279.4 151%
> Test5 292.2 563.9 193%

Very impressive.

An early version of what eventually became DSA worked with
backend-local memory and I saw very substantial memory usage
improvements on large sorts, similar to what you show here. I am not
sure I saw the same CPU improvements, and in any case I abandoned the
idea of using that infrastructure to manage backend-local memory at
some point, since the whole thing had lots of problems that I didn't
know how to solve. What you've done here looks like a much more
promising approach.

--
Robert Haas
EDB: http://www.enterprisedb.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message John Naylor 2021-07-30 14:53:58 Re: A qsort template
Previous Message Tom Lane 2021-07-30 14:17:39 Re: Case expression pushdown