Sorry. Stupid question. I didn't realize SQL allowed for the column
to be identified by number. I've never seen that before. :-)
Cheers,
mark
On Tue, Oct 03, 2006 at 06:47:35PM -0400, mark@mark.mielke.cc wrote:
> On Tue, Oct 03, 2006 at 03:44:38PM -0400, Tom Lane wrote:
> > select count(*) from
> > (select random()::text from generate_series(1,1000000) order by 1) ss;
> > ...
> > postgres=# select count(*) from (select random() from generate_series(1,1000000) order by 1) ss;
>
> I'm wondering whether 'order by 1' is representative of a real sort, from
> the perspective of benchmarks.
>
> I wonder why 'order by CONSTANT' might not be safe to optimize away as
> no sort at all?
>
> For sort functions that incrementally improve the sort order, I would
> expect 'order by 1' to be a worst case scenario. Is that the intention?
> Or is qsort unaffected by this use?
--
mark@mielke.cc / markm@ncf.ca / markm@nortel.com __________________________
. . _ ._ . . .__ . . ._. .__ . . . .__ | Neighbourhood Coder
|\/| |_| |_| |/ |_ |\/| | |_ | |/ |_ |
| | | | | \ | \ |__ . | | .|. |__ |__ | \ |__ | Ottawa, Ontario, Canada
One ring to rule them all, one ring to find them, one ring to bring them all and in the darkness
bindthem...
http://mark.mielke.cc/