Re: A worst case for qsort - Mailing list pgsql-hackers

From Robert Haas
Subject Re: A worst case for qsort
Date
Msg-id CA+TgmobewrKKHG6wPovAmS3EZH+3kvD7Wv2uBWyiyyVbuzhidw@mail.gmail.com
Whole thread Raw
In response to Re: A worst case for qsort  (Peter Geoghegan <pg@heroku.com>)
Responses Re: A worst case for qsort
Re: A worst case for qsort
List pgsql-hackers
On Thu, Aug 7, 2014 at 5:52 PM, Peter Geoghegan <pg@heroku.com> wrote:
> On Thu, Aug 7, 2014 at 2:34 PM, Rod Taylor <rod.taylor@gmail.com> wrote:
>> This one is frequently sorted as batch operations against the files are
>> performed in alphabetical order to reduce conflict issues that a random
>> ordering may cause between jobs.
>
> Sure. There are cases out there. But, again, I have a hard time
> imagining why you'd expect those to be pre-sorted in practice, ...

Well, I'm not sure why you're having a hard time imagining it.
Presorted input is a common case in general; that's why we have a
check for it.  That check adds overhead in the non-pre-sorted case to
improve the pre-sorted case, and nobody's ever argued for removing it
that I can recall.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: replication commands and log_statements
Next
From: Marko Tiikkaja
Date:
Subject: pgcrypto: PGP armor headers