From: Tom Lane <tgl@sss.pgh.pa.us>
To: Scott Marlowe <scott.marlowe@gmail.com>
Cc: Heikki Linnakangas <hlinnakangas@vmware.com>
Cc: pgsql-performance <pgsql-performance@postgresql.org>
Subject: Re: Small performance regression in 9.2 has a big impact
Date: Tue, 25 Nov 2014 18:02:22 -0500
Message-ID: <24181.1416956542@sss.pgh.pa.us> (raw)
In-Reply-To: <CAOR=d=2Pr7mKCMDD-kY9EMRaOZWA51nPL+BQgGvOuwSMGiRGfA@mail.gmail.com>
References: <CAOR=d=3j1U_q-zf8+jUx1hkx8ps+N8pm=EUTqyFdJ5ov=+fawg@mail.gmail.com>
<5474ED7C.9030403@vmware.com>
<CAOR=d=2Pr7mKCMDD-kY9EMRaOZWA51nPL+BQgGvOuwSMGiRGfA@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-performance>
Scott Marlowe <scott.marlowe@gmail.com> writes:
> On Tue, Nov 25, 2014 at 1:58 PM, Heikki Linnakangas
> <hlinnakangas@vmware.com> wrote:
>> I don't know why this regressed between those versions, but looking at the
>> functions, there's some low-hanging fruit:
>>
>> 1. tree_ancestor_keys() could use UNION ALL instead of UNION. (I believe
>> duplicates are expected here, although I'm not 100% sure).
>>
>> 2. tree_ancestor_keys() calculates tree_level($1) every time it recurses.
>> Would be cheaper to calculate once, and pass it as argument.
> Wow that made a huge difference. About a 50% increase across the
> board. Sadly, 9.2 is still way behind 8.4 (see Tom's email)
Switching from UNION to UNION ALL would dodge the varbit hash-opclass
caching issue, I think. But there's still something else going on.
regards, tom lane
--
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance
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 using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: tgl@sss.pgh.pa.us, scott.marlowe@gmail.com, hlinnakangas@vmware.com
Subject: Re: Small performance regression in 9.2 has a big impact
In-Reply-To: <24181.1416956542@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