Re: Strange Create Index behaviour

Поиск
Список
Период
Сортировка
Искать
От
Tom Lane
Тема
Re: Strange Create Index behaviour
Дата
Msg-id
19510.1140036968@sss.pgh.pa.us
Ответ на
Список
Дерево обсуждения
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>
Gary Doades  writes:
> Platform: FreeBSD 6.0, Postgresql 8.1.2 compiled from the ports collection.

> If the column that is having the index created has a certain 
> distribution of values then create index takes a very long time. If the 
> data values (integer in this case) a fairly evenly distributed then 
> create index is very quick, if the data values are all the same it is 
> very quick. I discovered that in the slow cases the column had 
> approximately half the values as zero and the rest fairly spread out. 

Interesting.  I tried your test script and got fairly close times
for all the cases on two different machines:
	old HPUX machine: shortest 5800 msec, longest 7960 msec
	new Fedora 4 machine: shortest 461 msec, longest 608 msec
(the HPUX machine was doing other stuff at the same time, so some
of its variation is probably only noise).

So what this looks like to me is a corner case that FreeBSD's qsort
fails to handle well.

You might try forcing Postgres to use our private copy of qsort, as we
do on Solaris for similar reasons.  (The easy way to do this by hand
is to configure as normal, then alter the LIBOBJS setting in
src/Makefile.global to add "qsort.o", then proceed with normal build.)
However, I think that our private copy is descended from *BSD sources,
so it might have the same failure mode.  It'd be worth finding out.

> The final interesting thing is that as I increase shared buffers to 2000 
> or 3000 the problem gets *worse*

shared_buffers is unlikely to impact index build time noticeably in
recent PG releases.  maintenance_work_mem would affect it a lot, though.
What setting were you using for that?

Can anyone else try these test cases on other platforms?

			regards, tom lane
В списке pgsql-performance по дате отправления
От: Gary Doades
Дата:
Сообщение: Strange Create Index behaviour
От: Jeremy Haile
Дата:
FAQ