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

From: "Gary Doades" <gpd(at)gpdnet(dot)co(dot)uk>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: [HACKERS] qsort again (was Re: Strange Create Index
Date: 2006-02-16 15:42:36
Message-ID: 4383.84.92.210.49.1140104556.squirrel@www.gpdnet.co.uk
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:
>> I think the reason I wasn't seeing performance issues with normal sort
>> operations is because they use work_mem not maintenance_work_mem which
>> was
>> only set to 2048 anyway. Does that sound right?
>
> Very probable. Do you want to test the theory by jacking that up? ;-)

Hmm, played around a bit. I have managed to get it to do a sort on one of
the "bad" columns using a select of two whole tables that results in a
sequntial scan, sort and merge join. I also tried a simple select column
order by column for a bad column.

I tried varying maintenance_work_mem and work_mem up and down between 2048
and 65536 but I always get similar results. The sort phase always takes 4
to 5 seconds which seems about right for 900,000 rows.

This was on a colunm that took 12 minutes to create an index on.

I've no idea why it should behave this way, but probably explains why I
(and others) may not have noticed it before.

Regards,
Gary.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2006-02-16 15:52:19 Re: Generating config stuff from single source
Previous Message Tom Lane 2006-02-16 14:48:54 Re: [HACKERS] Patch Submission Guidelines

Browse pgsql-performance by date

  From Date Subject
Next Message Ron 2006-02-16 15:52:48 Re: qsort again (was Re: [PERFORM] Strange Create
Previous Message Martijn van Oosterhout 2006-02-16 14:48:33 Re: qsort again (was Re: [PERFORM] Strange Create Index