Re: [HACKERS] qsort again (was Re: Strange Create Index behaviour) - Mailing list pgsql-performance

From Tom Lane
Subject Re: [HACKERS] qsort again (was Re: Strange Create Index behaviour)
Date
Msg-id 21152.1140049020@sss.pgh.pa.us
Whole thread Raw
In response to Re: qsort again (was Re: Strange Create Index behaviour)  (Gary Doades <gpd@gpdnet.co.uk>)
Responses Re: [HACKERS] qsort again (was Re: Strange Create Index behaviour)  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-performance
Gary Doades <gpd@gpdnet.co.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

pgsql-performance by date:

Previous
From: Tom Lane
Date:
Subject: Re: qsort again (was Re: Strange Create Index behaviour)
Next
From: Ron
Date:
Subject: Re: qsort again (was Re: Strange Create Index