Skip site navigation (1) Skip section navigation (2)

Re: Inlining comparators as a performance optimisation

From: Peter Geoghegan <peter(at)2ndquadrant(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Inlining comparators as a performance optimisation
Date: 2011-12-01 16:44:55
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
Attached is revision of my patch with some clean-ups. In particular,
I'm now using switch statements for greater readability, plus
supporting fast path sorting of the time datatype. I've also updated
the documentation on "Date/Time Types" to note the additional
disadvantage of using the deprecated "store timestamp + friends as
double precision floating-point numbers" compile time option.

There is one aspect to this optimisation that I haven't touched on,
which is the effect on memory consumption. I think that much of the
value that this patch will deliver will come from being able to
release sort memory earlier. Consider that the substantial
improvements in raw sorting speed (far more substantial than the
improvements in query runtime) will sometimes result in a concomitant
reduction in the time that the executor holds onto memory allocated
for sorting. Maybe the effect will only be really noticeable for plans
with a sort node as their root node, but that isn't exactly a rare
occurrence, particularly among large, expensive sorts.

Peter Geoghegan
PostgreSQL Development, 24x7 Support, Training and Services

Attachment: readability_inline_compar.patch
Description: text/x-patch (22.1 KB)

In response to


pgsql-hackers by date

Next:From: Robert HaasDate: 2011-12-01 16:47:52
Subject: Re: synchronous commit vs. hint bits
Previous:From: Andres FreundDate: 2011-12-01 16:32:10
Subject: Re: Command Triggers

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group