From: | Yuya Watari <watari(dot)yuya(at)gmail(dot)com> |
---|---|
To: | Andrey Lepikhov <a(dot)lepikhov(at)postgrespro(dot)ru>, Thom Brown <thom(at)linux(dot)com> |
Cc: | Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Zhang Mingli <zmlpostgres(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, David Rowley <dgrowleyml(at)gmail(dot)com>, PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
Subject: | Re: [PoC] Reducing planning time when tables have many partitions |
Date: | 2022-11-29 08:58:25 |
Message-ID: | CAJ2pMkZL7pcBOE69j-ZfHZ5kZjVRPOo9AvEKPZ1OsmYg5Uz_SA@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Dear Andrey and Thom,
Thank you for reviewing and testing the patch. I really apologize for
my late response.
On Tue, Nov 8, 2022 at 8:31 PM Andrey Lepikhov
<a(dot)lepikhov(at)postgrespro(dot)ru> wrote:
> Looking into find_em_for_rel() changes I see that you replaced
> if (bms_is_subset(em->em_relids, rel->relids)
> with assertion statement.
> According of get_ecmember_indexes(), the em_relids field of returned
> equivalence members can contain relids, not mentioned in the relation.
> I don't understand, why it works now? For example, we can sort by t1.x,
> but have an expression t1.x=t1.y*t2.z. Or I've missed something? If it
> is not a mistake, maybe to add a comment why assertion here isn't failed?
As you pointed out, changing the bms_is_subset() condition to an
assertion is logically incorrect here. Thank you for telling me about
it. I fixed it and attached the modified patch to this email.
On Thu, Nov 17, 2022 at 9:05 PM Thom Brown <thom(at)linux(dot)com> wrote:
> No issues with applying. Created 1024 partitions, each of which is
> partitioned into 64 partitions.
>
> I'm getting a generic planning time of 1415ms. Is that considered
> reasonable in this situation? Bear in mind that the planning time
> prior to this patch was 282311ms, so pretty much a 200x speedup.
Thank you for testing the patch with an actual query. This speedup is
very impressive. When I used an original query with 1024 partitions,
its planning time was about 200ms. Given that each partition is also
partitioned in your workload, I think the result of 1415ms is
reasonable.
--
Best regards,
Yuya Watari
Attachment | Content-Type | Size |
---|---|---|
v9-0001-Apply-eclass_member_speedup_v3.patch.patch | application/octet-stream | 88.3 KB |
v9-0002-Revert-one-of-the-optimizations.patch | application/octet-stream | 2.0 KB |
v9-0003-Use-conventional-algorithm-for-smaller-size-cases.patch | application/octet-stream | 2.8 KB |
v9-0004-Fix-incorrect-assertion.patch | application/octet-stream | 1018 bytes |
From | Date | Subject | |
---|---|---|---|
Next Message | Alvaro Herrera | 2022-11-29 09:27:08 | Re: ExecRTCheckPerms() and many prunable partitions |
Previous Message | wangw.fnst@fujitsu.com | 2022-11-29 08:49:20 | RE: Avoid distributing new catalog snapshot again for the transaction being decoded. |