Re: Speeding up INSERTs and UPDATEs to partitioned tables

From: Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>
To: David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Speeding up INSERTs and UPDATEs to partitioned tables
Date: 2018-08-23 00:55:06
Message-ID: 0c1f65aa-321e-d071-19a9-f3693c8a34d3@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2018/08/22 21:30, David Rowley wrote:
> On 22 August 2018 at 19:08, Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp> wrote:
>> +#define PartitionTupRoutingGetToParentMap(p, i) \
>> +#define PartitionTupRoutingGetToChildMap(p, i) \
>>
>> If the "Get" could be replaced by "Child" and "Parent", respectively,
>> they'd sound more meaningful, imho.
>
> I did that to save 3 chars. I think putting the additional
> Child/Parent in the name is not really required. It's not as if we're
> going to have a ParentToParent or a ChildToChild map, so I thought it
> might be okay to assume that if it's "ToParent", that it's being
> converted from the child and "ToChild" seems safe to assume it's being
> converted from the parent. I can change it though if you feel very
> strongly that what I've got is no good.

No strong preference as such. Maybe, let's defer to committer.

>> I've looked at v6 and spotted some minor typos.
>>
>> + * ResultRelInfo for, before we go making one, we check for a
>> pre-made one
>>
>> s/making/make/g
>
> I disagree, but perhaps we can just reword it a bit. I've now got:
>
> + * Every time a tuple is routed to a partition that we've yet to set the
> + * ResultRelInfo for, before we go to the trouble of making one, we check
> + * for a pre-made one in the hash table.

Sure. I guess "to the trouble of" was missing then. :)

>> + /* If nobody else set the per-subplan array of maps, do so ouselves. */
>>
>> I guess I'm the one to blame here for misspelling "ourselves".
>
> Thanks for noticing.
>
>> Since the above two are minor issues, fixed them myself in the attached
>> updated version; didn't touch the macro though.
>
> I've attached a v8. The only change from your v7 is in the "go making" comment.

Thanks.

>> Do you agree to setting this patch to "Ready for Committer" in the
>> September CF?
>
> I read through the entire patch a couple of times yesterday and saw
> nothing else, so yeah, I think now is a good time for someone with
> more authority to have a look at it.

Okay, doing it now.

Thanks,
Amit

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jonathan S. Katz 2018-08-23 01:00:42 Re: Query is over 2x slower with jit=on
Previous Message David Rowley 2018-08-23 00:25:04 Re: Removing useless DISTINCT clauses