Re: WITHIN GROUP patch

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>, Atri Sharma <atri(dot)jiit(at)gmail(dot)com>, Peter Eisentraut <peter_e(at)gmx(dot)net>, Vik Fearing <vik(dot)fearing(at)dalibo(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Subject: Re: WITHIN GROUP patch
Date: 2014-01-05 07:53:54
Message-ID: CAApHDvq-nPdOgiYSLRce4BSzbmBbMLMyRt468XxHdVP2B7gnsw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Jan 5, 2014 at 12:00 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
>
> Looking at this example makes me wonder if it wouldn't be worthwhile to
> provide a way to reset and re-use a tuplesort object, instead of redoing
> all the lookup work involved. Or maybe just find a way to cache the
> catalog lookups that are happening inside tuplesort_begin_datum, which are
> about 50% of that function's cost it looks like. We're paying this same
> kind of price for repeated tuplesort setup in the existing nodeAgg code,
> if we have an aggregate with ORDER BY or DISTINCT in a grouped query with
> many groups.
>
>
This sounds very similar to:
http://www.postgresql.org/message-id/CAApHDvrbq348M8dYj-7O4VaE5PS9ZoQ_34rGvaaN1QYXL2SP_A@mail.gmail.com
A reset function was added in the next patch which improved performance in
my test case by about 5 times.

Perhaps they can make use of the same function.

Regards

David Rowley

> regards, tom lane
>
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Craig Ringer 2014-01-05 12:29:00 Re: Fixing pg_basebackup with tablespaces found in $PGDATA
Previous Message MauMau 2014-01-05 07:40:17 Re: [bug fix] multibyte messages are displayed incorrectly on the client