Re: [CDBI] Make CDBI go fast

"Perrin Harkins" <[email protected]> Wed, 21 Mar 2007 11:20:14 -0400
Newsgroups gmane.comp.lang.perl.modules.class-dbi
Message-ID <[email protected]>
On 3/21/07, Dave Howorth <dhoworth-fDajt2Yx3S8pY9vWkoisglpr/1R2p/[email protected]> wrote:
> Don't you just need to run through the file once, updating the current
> first 11 at each step? I.e. compare each element against the current
> 11th and swap the element into the current 11 if appropriate.
> Potentially a lot less comparisons and exchanges than sorting the
> complete file.

Arguably still sorting, but yes, it would probably be faster to sort
into just 12 buckets.

The big win though is to make it so your sort can be handled by
indexes.  Once it goes to filesort on any large amount of data, it's
not going to be fast.

- Perrin