Re: Declarative partitioning - another take

From: Ildar Musin <i(dot)musin(at)postgrespro(dot)ru>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Dmitry Ivanov <d(dot)ivanov(at)postgrespro(dot)ru>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, Erik Rijkers <er(at)xs4all(dot)nl>, Amit Langote <amitlangote09(at)gmail(dot)com>, Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>, Rajkumar Raghuwanshi <rajkumar(dot)raghuwanshi(at)enterprisedb(dot)com>, Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>, pgsql-hackers-owner(at)postgresql(dot)org
Subject: Re: Declarative partitioning - another take
Date: 2016-12-14 12:25:15
Message-ID: fc4afab5-a545-9884-8d59-55c3fece4791@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 13.12.2016 21:10, Robert Haas wrote:
> On Tue, Dec 13, 2016 at 12:22 PM, Ildar Musin <i(dot)musin(at)postgrespro(dot)ru> wrote:
>> We've noticed that PartitionDispatch object is built on every INSERT query
>> and that it could create unnecessary overhead. Wouldn't it be better to keep
>> it in relcache?
>
> You might be able to cache some of that data in the relcache, but List
> *keystate is pointing to query-lifespan data, so you can't cache that.
>

Yes, you are right. I meant mostly the 'indexes' field. I've measured
insert performance with perf in case when there are thousand partitions
and it seems that 34% of the time it takes to run
RelationGetPartitionDispatchInfo() which builds this indexes array. And
the most of the time it spends on acquiring locks on all partitions
which is unnecessary if we're inserting in just a single partition.
Probably we could avoid this by moving at least indexes field into cache.

--
Ildar Musin
i(dot)musin(at)postgrespro(dot)ru

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jesper Pedersen 2016-12-14 13:32:11 Re: pg_catversion builtin function
Previous Message Heikki Linnakangas 2016-12-14 11:33:10 Re: pg_authid.rolpassword format (was Re: Password identifiers, protocol aging and SCRAM protocol)