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

From Rod Taylor
Subject Re: A worst case for qsort
Date
Msg-id CAKddOFAfkp_3M7k+-==qcGO8FRPX=6QP9FNtsSwCMFM+pZdpiA@mail.gmail.com
Whole thread Raw
In response to Re: A worst case for qsort  (Rod Taylor <rod.taylor@gmail.com>)
Responses Re: A worst case for qsort
List pgsql-hackers
Sigh. Found another example.

A table with 15 million entries and a unique key on filesystem location for things users created via a web interface.

Entries all begin with /usr/home/ ...

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.

regards,

Rod




On Thu, Aug 7, 2014 at 5:23 PM, Rod Taylor <rod.taylor@gmail.com> wrote:

On Thu, Aug 7, 2014 at 3:06 PM, Peter Geoghegan <pg@heroku.com> wrote:
I think that pre-sorted, all-unique text datums, that have all
differences beyond the first 8 bytes, that the user happens to
actually want to sort are fairly rare.

While I'm sure it's not common, I've seen a couple of ten-million tuple tables having a URL column as primary key where 98% of the entries begin with 'http://www.'

So, that exact scenario is out there.

pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: A worst case for qsort
Next
From: Peter Geoghegan
Date:
Subject: Re: A worst case for qsort