RE: [HACKERS] sorting big tables :( - Mailing list pgsql-hackers

From Stupor Genius
Subject RE: [HACKERS] sorting big tables :(
Date
Msg-id 000301bd8449$3c57ada0$7f99accf@darren
Whole thread Raw
In response to Re: [HACKERS] sorting big tables :(  (Michal Mosiewicz <mimo@interdata.com.pl>)
List pgsql-hackers
> Last question... What's the purpose of such a big sort? If somebody gets
> 40M of sorted records in a result of some query, what would he do with
> it? Is he going to spent next years on reading this lecture? I mean,
> isn't it worth to query the database for necessary informations only and
> then sort it?

Not all query results are for human eyes.  I'd venture to say that more
queries are fed into report generators for formatting than are looked at
directly from psql.

A sort is required in some cases where not explicitly requested.

For example, a GROUP BY clause.  You _could_ get the data back ungrouped,
but then you'd have to pipe it to another application or script to do the
sorting and then the grouping (or perhaps group on the fly).  But then
perhaps that app/script will eat all the memory or disk space and you'd
be in the same pickle as before.

darrenk

pgsql-hackers by date:

Previous
From: "Henry B. Hotz"
Date:
Subject: Re: [HACKERS] Kerberos 5 breakage.
Next
From: Oleg Broytmann
Date:
Subject: Re: [HACKERS] sorting big tables :(