Re: PG qsort vs. Solaris

From: mark(at)mark(dot)mielke(dot)cc
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Neil Conway <neilc(at)samurai(dot)com>, Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: PG qsort vs. Solaris
Date: 2006-10-03 22:49:40
Message-ID: 20061003224940.GB1112@mark.mielke.cc
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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(at)mark(dot)mielke(dot)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(at)mielke(dot)cc / markm(at)ncf(dot)ca / markm(at)nortel(dot)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 bind them...

http://mark.mielke.cc/

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2006-10-03 22:54:15 Re: buildfarm failures in ECPG-Check
Previous Message Tom Lane 2006-10-03 22:49:39 Re: PG qsort vs. Solaris