Re: sequential scan on select distinct

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Greg Stark <gsstark(at)mit(dot)edu>
Cc: Pierre-Frédéric Caillaud <lists(at)boutiquenumerique(dot)com>, "Ole Langbehn" <ole(at)freiheit(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: sequential scan on select distinct
Date: 2004-10-06 20:20:03
Message-ID: 29712.1097094003@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Greg Stark <gsstark(at)mit(dot)edu> writes:
> But regardless of how uncommon it is, it could be considered important in
> another sense: when you need it there really isn't any alternative. It's an
> algorithmic improvement with no bound on the performance difference.

[ shrug... ] There are an infinite number of special cases for which
that claim could be made. The more we load down the planner with
seldom-useful special cases, the *lower* the overall performance will
be, because we'll waste cycles checking for the special cases in every
case ...

In this particular case, it's not merely a matter of the planner, either.
You'd need some new type of plan node in the executor, so there's a
pretty fair amount of added code bulk that will have to be written and
then maintained.

I'm open to being persuaded that this is worth doing, but the bar is
going to be high; I think there are a lot of other more-profitable ways
to invest our coding effort and planning cycles.

regards, tom lane

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Gabriele Bartolini 2004-10-06 21:36:05 Data warehousing requirements
Previous Message Doug Y 2004-10-06 20:04:52 The never ending quest for clarity on shared_buffers