Re: qsort again (was Re: [PERFORM] Strange Create Index behaviour)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Gary Doades <gpd(at)gpdnet(dot)co(dot)uk>
Cc: pgsql-performance(at)postgresql(dot)org, pgsql-hackers(at)postgresql(dot)org
Subject: Re: qsort again (was Re: [PERFORM] Strange Create Index behaviour)
Date: 2006-02-16 00:17:00
Message-ID: 21152.1140049020@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-performance

Gary Doades <gpd(at)gpdnet(dot)co(dot)uk> writes:
> Ouch! That confirms my problem. I generated the random test case because
> it was easier than including the dump of my tables, but you can
> appreciate that tables 20 times the size are basically crippled when it
> comes to creating an index on them.

Actually... we only use qsort when we have a sorting problem that fits
within the allowed sort memory. The external-sort logic doesn't go
through that code at all. So all the analysis we just did on your test
case doesn't necessarily apply to sort problems that are too large for
the sort_mem setting.

The test case would be sorting 200000 index entries, which'd probably
occupy at least 24 bytes apiece of sort memory, so probably about 5 meg.
A problem 20 times that size would definitely not fit in the default
16MB maintenance_work_mem. Were you using a large value of
maintenance_work_mem for your restore?

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ron 2006-02-16 00:57:51 Re: qsort again (was Re: [PERFORM] Strange Create Index
Previous Message Tom Lane 2006-02-16 00:04:46 Re: qsort again (was Re: [PERFORM] Strange Create Index behaviour)

Browse pgsql-performance by date

  From Date Subject
Next Message Ron 2006-02-16 00:57:51 Re: qsort again (was Re: [PERFORM] Strange Create Index
Previous Message Tom Lane 2006-02-16 00:04:46 Re: qsort again (was Re: [PERFORM] Strange Create Index behaviour)