Re: Partition-wise join for join between (declaratively) partitioned tables
Robert Haas <robertmhaas@gmail.com>
On Wed, Jul 19, 2017 at 7:45 PM, Thomas Munro <thomas.munro@enterprisedb.com> wrote: > On Thu, Jul 20, 2017 at 7:00 AM, Robert Haas <robertmhaas@gmail.com> wrote: >> I think the problem is that the row count estimates for the child >> joins seem to be totally bogus: >> >> -> Hash Semi Join (cost=309300.53..491665.60 rows=1 width=12) >> (actual time=10484.422..15945.851 rows=1523493 loops=3) >> Hash Cond: (l1.l_orderkey = l2.l_orderkey) >> Join Filter: (l2.l_suppkey <> l1.l_suppkey) >> Rows Removed by Join Filter: 395116 >> >> That's clearly wrong. In the un-partitioned plan, the join to l2 >> produces about as many rows of output as the number of rows that were >> input (998433 vs. 962909); but here, a child join with a million rows >> as input is estimated to produce only 1 row of output. I bet the >> problem is that the child-join's row count estimate isn't getting >> initialized at all, but then something is clamping it to 1 row instead >> of 0. >> >> So this looks like a bug in Ashutosh's patch. > > Isn't this the same as the issue reported here? > > https://www.postgresql.org/message-id/flat/CAEepm%3D270ze2hVxWkJw-5eKzc3AB4C9KpH3L2kih75R5pdSogg%40mail.gmail.com Hmm, possibly. But why would that affect the partition-wise join case only? -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company
Commits
-
Basic partition-wise join functionality.
- f49842d1ee31 11.0 landed
-
Assorted preparatory refactoring for partition-wise join.
- e139f1953f29 11.0 landed
-
Teach adjust_appendrel_attrs(_multilevel) to do multiple translations.
- 480f1f4329f1 11.0 landed
-
Stamp 10beta2.
- 42171e2cd23c 10.0 cited
-
Eat XIDs more efficiently in recovery TAP test.
- 08aed6604de2 10.0 cited
-
Abstract logic to allow for multiple kinds of child rels.
- 7a39b5e4d112 10.0 landed
-
Implement SortSupport for macaddr data type
- f90d23d0c518 10.0 cited
-
Attempt to stabilize grouping sets regression test plans.
- de4da168d57d 10.0 cited
-
Teach xlogreader to follow timeline switches
- 1148e22a82ed 10.0 cited
-
Don't scan partitioned tables.
- d3cc37f1d801 10.0 cited
-
Fix grammar.
- b4ff8609dbad 10.0 cited
-
postgres_fdw: Push down FULL JOINs with restriction clauses.
- b30fb56b07a8 10.0 cited
-
Some preliminary refactoring towards partitionwise join.
- c44c47a773bd 10.0 landed
-
contrib/amcheck needs RecentGlobalXmin to be PGDLLIMPORT'ified.
- 56018bf26eec 10.0 cited
-
Print test parameters like "foo: 123", and results like "foo = 123".
- 2a7f4f76434d 10.0 cited