Simon Riggs <[EMAIL PROTECTED]> writes:
> On Mon, 2005-04-25 at 11:23 -0400, Tom Lane wrote:
>> It's not just the scan --- you also have to sort, or something like
>> that, if you want to count distinct values.  I doubt anyone is really
>> going to consider this a feasible answer for large tables.

> Assuming you don't use the HashAgg plan, which seems very appropriate
> for the task? (...but I understand the plan otherwise).

The context here is a case with a very large number of distinct
values... keep in mind also that we have to do this for *all* the
columns of the table.  A full-table scan for each column seems
right out to me.

                        regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faq

Reply via email to