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

From Gary Doades
Subject Re: [HACKERS] qsort again (was Re: Strange Create Index
Date
Msg-id 4383.84.92.210.49.1140104556.squirrel@www.gpdnet.co.uk
Whole thread Raw
In response to 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:
>> 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.



pgsql-performance by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: [HACKERS] qsort again (was Re: Strange Create Index
Next
From: Ron
Date:
Subject: Re: [HACKERS] qsort again (was Re: Strange Create