Re: [HACKERS] advanced partition matching algorithm for partition-wise join
Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>
From: Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>
To: Dmitry Dolgov <9erthalion6@gmail.com>
Cc: Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>,
Robert Haas <robertmhaas@gmail.com>, Antonin Houska <ah@cybertec.at>,
PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2018-07-23T08:38:44Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Suppress unused-variable warning.
- 401418ca6a68 13.0 landed
-
Allow partitionwise joins in more cases.
- c8434d64ce03 13.0 landed
-
Avoid crash in partitionwise join planning under GEQO.
- 7ad6498fd5a6 12.0 cited
- d70c147fa217 11.3 cited
-
Disable support for partitionwise joins in problematic cases.
- 7cfdc77023ad 12.0 cited
-
Add plan_cache_mode setting
- f7cb2842bf47 12.0 cited
-
Add test for partitionwise join involving default partition.
- 4513d3a4be0b 12.0 cited
-
Revise API for partition_rbound_cmp/partition_rbound_datum_cmp.
- b0229235564f 11.0 landed
On Fri, Jul 20, 2018 at 3:13 AM, Dmitry Dolgov <9erthalion6@gmail.com> wrote: > > It's of course wrong, it's going to be O(max(m, n)) as you said, but > the point is still valid - if we have partitions A1, A2 from one side > and B1, ..., BN on another side, we can skip necessary the > partitions from B that are between e.g. A1 and A2 faster with > binary search. That's possible only when there is no default partition and the join is an inner join. For an outer join, we need to include all the partitions on the outer side, so we can't just skip over some partitions. In case of a default partition, it can take place of a missing partition, so we can't skip partitions using binary search. The code right now works for all the cases and is O(n). I agree that it can be optimized for certain cases, but 1. those cases are rare enough that we can ignore those right now. How many times we would encounter the case you have quoted, for example? Usually the ranges will be continuous only differing in the first or last partition e.g time-series data. 2. The code is enough complex right now and it's also a lot. Making it complicated further is not the worth the rare use cases. If we get complaints from the field, we can certainly improve it in future. But I would wait for those complaints before improving it further. -- Best Wishes, Ashutosh Bapat EnterpriseDB Corporation The Postgres Database Company