Re: PoC: Duplicate Tuple Elidation during External Sort for DISTINCT

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jeremy Harris <jgh(at)wizmail(dot)org>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: PoC: Duplicate Tuple Elidation during External Sort for DISTINCT
Date: 2014-01-22 21:26:49
Message-ID: 19539.1390426009@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Jeremy Harris <jgh(at)wizmail(dot)org> writes:
> On 22/01/14 03:53, Tom Lane wrote:
>> Jon Nelson <jnelson+pgsql(at)jamponi(dot)net> writes:
>>> - in createplan.c, eliding duplicate tuples is enabled if we are
>>> creating a unique plan which involves sorting first

>> [ raised eyebrow ... ] And what happens if the planner drops the
>> unique step and then the sort doesn't actually go to disk?

> I don't think Jon was suggesting that the planner drop the unique step.

Hm, OK, maybe I misread what he said there. Still, if we've told
tuplesort to remove duplicates, why shouldn't we expect it to have
done the job? Passing the data through a useless Unique step is
not especially cheap.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Joseph Kregloh 2014-01-22 21:33:47 Re: pg_upgrade & tablespaces
Previous Message Tom Lane 2014-01-22 21:22:47 Re: Storing pg_stat_statements query texts externally, pg_stat_statements in core