Re: Inlining comparators as a performance optimisation - Mailing list pgsql-hackers

From Greg Stark
Subject Re: Inlining comparators as a performance optimisation
Date
Msg-id CAM-w4HOGCv3J=JONM6m4c0rnCmKsFY=dogFd2P60=AAifBGWsQ@mail.gmail.com
Whole thread Raw
In response to Re: Inlining comparators as a performance optimisation  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Responses Re: Inlining comparators as a performance optimisation
List pgsql-hackers
On Wed, Sep 21, 2011 at 8:08 AM, Heikki Linnakangas
<heikki.linnakangas@enterprisedb.com> wrote:
>> How about almost every primary index creation?
>
> Nope. Swamped by everything else.

Really? I think it's pretty common for shops to be able to dedicate
large amounts of RAM to building initial indexes on data loads or
reindex operations. Enough that they can cache the entire table for
the short time they're doing the index builds even if they're quite
large. Witness the recent pleas to allow maintenance_work_mem on the
order of tens of gigabytes. And it's also pretty common that shops can
dedicate very large I/O bandwidth, in many cases enough to saturate
the memory bandwidth, for doing these kinds of batch operations when
they get large enough to need to do an external sort.

There's still overhead of reading the pages, the tuples, finding the
sort keys in the tuple, etc. But I think the actual qsort or heap
operations in tapesort are pretty big portions of the work.

This is pretty easy to measure. Just run oprofile or gprof and see
what percentage of time for a big index build is spent in qsort.

-- 
greg


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Range Types - typo + NULL string constructor
Next
From: Robert Haas
Date:
Subject: Re: Inlining comparators as a performance optimisation