From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jerry Sievers <jerry@jerrysievers.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: Curious run-away index build on upgrade to 8.1.3
Date: Thu, 16 Mar 2006 15:41:03 -0500
Message-ID: <19992.1142541663@sss.pgh.pa.us> (raw)
In-Reply-To: <m3wteukyu7.fsf@prod01.jerrysievers.com>
References: <m3pskmmp0a.fsf@prod01.jerrysievers.com>
<16725.1142523155@sss.pgh.pa.us>
<m37j6umlbp.fsf@prod01.jerrysievers.com>
<18502.1142533042@sss.pgh.pa.us>
<m3wteukyu7.fsf@prod01.jerrysievers.com>
Jerry Sievers <jerry@jerrysievers.com> writes:
> Tom Lane <tgl@sss.pgh.pa.us> writes:
>> What I still don't understand though is why you see it
>> in 8.1 and not 8.0 ... the src/port/qsort.c code didn't change at all
>> between those versions. Maybe 8.0 isn't taking the qsort code path,
>> perhaps because it uses a shade more memory or some such. Could you
>> try increasing maintenance_work_mem even more, like to 100M,
>> and see if 8.0 gets slow?
> I did as you suggest here; taking the MWM setting incrementally up to
> nearly a Gig in 100M increments, also raised and lowered the work_mem
> setting too.
> Tried a dozen or more combos and in every case, the index built
> quickly on 8.0.3.
On further analysis, it seems the problem is dependent on the exact
ordering of the inputs to the qsort function. So not only do you need
maintenance_work_mem to be large enough that the code will try to use
qsort, but the physical order of the rows in the table matters.
I suspect that you are testing on an 8.0 table with a different physical
row order --- if you drop the table and reload it from the same dump you
loaded into 8.1, does it get slow?
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: tgl@sss.pgh.pa.us, jerry@jerrysievers.com
Subject: Re: Curious run-away index build on upgrade to 8.1.3
In-Reply-To: <19992.1142541663@sss.pgh.pa.us>
References: <m3pskmmp0a.fsf@prod01.jerrysievers.com> <16725.1142523155@sss.pgh.pa.us> <m37j6umlbp.fsf@prod01.jerrysievers.com> <18502.1142533042@sss.pgh.pa.us> <m3wteukyu7.fsf@prod01.jerrysievers.com> <19992.1142541663@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox