Re: speeding up planning with partitions

From: Justin Pryzby <pryzby(at)telsasoft(dot)com>
To: Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>, "Imai, Yoshikazu" <imai(dot)yoshikazu(at)jp(dot)fujitsu(dot)com>, Amit Langote <amitlangote09(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: speeding up planning with partitions
Date: 2019-02-22 16:59:32
Message-ID: 20190222165932.GG28750@telsasoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Feb 22, 2019 at 09:45:38PM +0900, Amit Langote wrote:
> I have updated the inheritance expansion patch.
>
> Patch 0001 rewrites optimizer/utils/inherit.c, so that it allows

Thanks for your continued work on this.

I applied v23 patch and imported one of our customers' schema, and ran explain
on a table with 210 partitions. With patch applied there are 10x fewer system
calls, as intended.

with patch:
173 pread64
76 lseek
47 open
38 brk

without patch:
1276 lseek
693 pread64
647 open
594 brk

> + if (IS_SIMPLE_REL(rel1) && child_rel1 == NULL)
> + child_rel1 = build_dummy_partition_rel(root, rel1, baserel1,
> + cnt_parts);
> + if (IS_SIMPLE_REL(rel1) && child_rel2 == NULL)
> + child_rel2 = build_dummy_partition_rel(root, rel2, baserel2,
> + cnt_parts);

Should 2nd "if" say IS_SIMPLE_REL(rel2) ?

Justin

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Steele 2019-02-22 17:11:41 Re: Remove Deprecated Exclusive Backup Mode
Previous Message Robert Haas 2019-02-22 16:49:49 Re: Autovaccuum vs temp tables crash