Re: [HACKERS] qsort again (was Re: Strange Create

Поиск
Список
Период
Сортировка
Искать
От
Markus Schaber
Тема
Re: [HACKERS] qsort again (was Re: Strange Create
Дата
Msg-id
43F5A341.5090808@logix-tt.com
Ответ на
Список
Дерево обсуждения
Strange Create Index behaviour Gary Doades <gpd@gpdnet.co.uk>
Re: Strange Create Index behaviour Simon Riggs <simon@2ndquadrant.com>
Re: Strange Create Index behaviour Tom Lane <tgl@sss.pgh.pa.us>
Re: Strange Create Index behaviour Simon Riggs <simon@2ndquadrant.com>
Re: Strange Create Index behaviour Tom Lane <tgl@sss.pgh.pa.us>
Re: Strange Create Index behaviour Tom Lane <tgl@sss.pgh.pa.us>
Re: Strange Create Index behaviour Gary Doades <gpd@gpdnet.co.uk>
Re: Strange Create Index behaviour Tom Lane <tgl@sss.pgh.pa.us>
Re: Strange Create Index behaviour Simon Riggs <simon@2ndquadrant.com>
qsort again (was Re: Strange Create Index behaviour) Tom Lane <tgl@sss.pgh.pa.us>
Re: [HACKERS] qsort again (was Re: Strange Create Index Neil Conway <neilc@samurai.com>
Re: [HACKERS] qsort again Florian Weimer <fw@deneb.enyo.de>
Re: [HACKERS] qsort again Martijn van Oosterhout <kleptog@svana.org>
Re: [HACKERS] qsort again Sven Geisler <sgeisler@aeccom.com>
Re: [HACKERS] qsort again Ron <rjpeace@earthlink.net>
Re: qsort again (was Re: Strange Create Index behaviour) Tom Lane <tgl@sss.pgh.pa.us>
Poor performance o "Craig A. James" <cjames@modgraph-usa.com>
Re: Poor performance o Tom Lane <tgl@sss.pgh.pa.us>
Re: Poor performance o "Craig A. James" <cjames@modgraph-usa.com>
Re: Poor performance o Tom Lane <tgl@sss.pgh.pa.us>
Re: Poor performance o "Jim C. Nasby" <jnasby@pervasive.com>
Re: qsort again (was Re: Strange Create Index behaviour) Gary Doades <gpd@gpdnet.co.uk>
Re: qsort again (was Re: Strange Create Index behaviour) Tom Lane <tgl@sss.pgh.pa.us>
Re: [HACKERS] qsort again (was Re: Strange Create Index behaviour) Tom Lane <tgl@sss.pgh.pa.us>
Re: [HACKERS] qsort again (was Re: Strange Create Index behaviour) Tom Lane <tgl@sss.pgh.pa.us>
Re: [HACKERS] qsort again (was Re: Strange Create Index Simon Riggs <simon@2ndquadrant.com>
Re: [HACKERS] qsort again (was Re: Strange Create Index "Gary Doades" <gpd@gpdnet.co.uk>
Re: [HACKERS] qsort again (was Re: Strange Create Index behaviour) Tom Lane <tgl@sss.pgh.pa.us>
Re: [HACKERS] qsort again (was Re: Strange Create Index "Gary Doades" <gpd@gpdnet.co.uk>
Re: qsort again (was Re: Strange Create Index behaviour) Christopher Kings-Lynne <chriskl@familyhealth.com.au>
Re: qsort again (was Re: Strange Create Index Ron <rjpeace@earthlink.net>
Re: qsort again (was Re: Strange Create Index behaviour) Tom Lane <tgl@sss.pgh.pa.us>
Re: qsort again (was Re: Strange Create Index Ron <rjpeace@earthlink.net>
Re: qsort again (was Re: Strange Create Index "Steinar H. Gunderson" <sgunderson@bigfoot.com>
Re: qsort again (was Re: Strange Create Index Neil Conway <neilc@samurai.com>
Re: qsort again (was Re: Strange Create Index Ron <rjpeace@earthlink.net>
Re: [HACKERS] qsort again (was Re: Strange Create Index Martijn van Oosterhout <kleptog@svana.org>
Re: [HACKERS] qsort again (was Re: Strange Create Ron <rjpeace@earthlink.net>
Re: [HACKERS] qsort again (was Re: Strange Create Tom Lane <tgl@sss.pgh.pa.us>
Re: [HACKERS] qsort again (was Re: Strange Create Ron <rjpeace@earthlink.net>
Re: [HACKERS] qsort again (was Re: Strange Create Martijn van Oosterhout <kleptog@svana.org>
Re: [HACKERS] qsort again (was Re: Strange Create Scott Lamb <slamb@slamb.org>
Re: [HACKERS] qsort again (was Re: Strange Create Ron <rjpeace@earthlink.net>
Re: [HACKERS] qsort again (was Re: Strange Create Ron <rjpeace@earthlink.net>
Re: [HACKERS] qsort again (was Re: Strange Create Ragnar <gnari@hive.is>
Re: [HACKERS] qsort again (was Re: Strange Create Ron <rjpeace@earthlink.net>
Re: [HACKERS] qsort again (was Re: Strange Create Ragnar <gnari@hive.is>
Re: [HACKERS] qsort again (was Re: Strange Create "Gregory Maxwell" <gmaxwell@gmail.com>
Re: [HACKERS] qsort again (was Re: Strange Create Markus Schaber <schabi@logix-tt.com>
Re: [HACKERS] qsort again (was Re: Strange Create Ron <rjpeace@earthlink.net>
Re: [HACKERS] qsort again (was Re: Strange Create Martijn van Oosterhout <kleptog@svana.org>
Re: [HACKERS] qsort again (was Re: Strange Create Ron <rjpeace@earthlink.net>
Re: [HACKERS] qsort again (was Re: Strange Create PFC <lists@peufeu.com>
Re: qsort again (was Re: Strange Create Index Markus Schaber <schabi@logix-tt.com>
Re: [HACKERS] qsort again (was Re: Strange Create Index "Jonah H. Harris" <jonah.harris@gmail.com>
Re: qsort again (was Re: Strange Create Index "Craig A. James" <cjames@modgraph-usa.com>
Re: [HACKERS] qsort again (was Re: Strange Create Index Tom Lane <tgl@sss.pgh.pa.us>
Re: [HACKERS] qsort again (was Re: Strange Create Index Mark Lewis <mark.lewis@mir3.com>
Re: [HACKERS] qsort again (was Re: Strange Create Index Martijn van Oosterhout <kleptog@svana.org>
Re: [HACKERS] qsort again (was Re: Strange Create Index Markus Schaber <schabi@logix-tt.com>
Re: [HACKERS] qsort again (was Re: Strange Create Index Greg Stark <gsstark@mit.edu>
Re: [HACKERS] qsort again (was Re: Strange Create Index Mark Lewis <mark.lewis@mir3.com>
Re: [HACKERS] qsort again (was Re: Strange Create Index David Lang <dlang@invendra.net>
Re: [HACKERS] qsort again (was Re: Strange Create Index Mark Lewis <mark.lewis@mir3.com>
Re: [HACKERS] qsort again (was Re: Strange Create Index Tom Lane <tgl@sss.pgh.pa.us>
Re: [HACKERS] qsort again (was Re: Strange Create Index Markus Schaber <schabi@logix-tt.com>
Re: [HACKERS] qsort again (was Re: Strange Create Index Scott Lamb <slamb@slamb.org>
Re: [HACKERS] qsort again (was Re: Strange Create Index Martijn van Oosterhout <kleptog@svana.org>
Re: [HACKERS] qsort again (was Re: Strange Create Index PFC <lists@peufeu.com>
Re: [HACKERS] qsort again (was Re: Strange Create Index "Steinar H. Gunderson" <sgunderson@bigfoot.com>
Re: [HACKERS] qsort again (was Re: Strange Create Index Markus Schaber <schabi@logix-tt.com>
Re: Strange Create Index behaviour Gary Doades <gpd@gpdnet.co.uk>
Re: Strange Create Index behaviour Gary Doades <gpd@gpdnet.co.uk>
Re: Strange Create Index behaviour Gary Doades <gpd@gpdnet.co.uk>
Hi, Ron,

Ron schrieb:

> OK, so here's _a_ way (there are others) to obtain a mapping such that
>  if a < b then f(a) < f (b) and
>  if a == b then f(a) == f(b)
> 
> Pretend each row is a integer of row size (so a 2KB row becomes a 16Kb
> integer; a 4KB row becomes a 32Kb integer; etc)
> Since even a 1TB table made of such rows can only have 256M - 512M
> possible values even if each row is unique, a 28b or 29b key is large
> enough to represent each row's value and relative rank compared to all
> of the others even if all row values are unique.
> 
> By scanning the table once, we can map say 0000001h (Hex used to ease
> typing) to the row with the minimum value and 1111111h to the row with
> the maximum value as well as mapping everything in between to their
> appropriate keys.  That same scan can be used to assign a pointer to
> each record's location.

But with a single linear scan, this cannot be accomplished, as the table
contents are neither sorted nor distributed linearly between the minimum
and the maximum.

For this mapping, you need a full table sort.

> That initial scan to set up the keys is expensive, but if we wish that
> cost can be amortized over the life of the table so we don't have to pay
> it all at once.  In addition, once we have created those keys, then can
> be saved for later searches and sorts.

But for every update or insert, you have to resort the keys, which is
_very_ expensive as it basically needs to update a huge part of the table.

Markus
В списке pgsql-performance по дате отправления
От: Markus Schaber
Дата:
От: PFC
Дата:
FAQ