Re: Declarative partitioning - another take
Amit Langote <langote_amit_f8@lab.ntt.co.jp>
Attachments
- multi-level-inh-lateral-join-info.patch (text/x-diff) patch
On 2016/09/27 18:09, Ashutosh Bapat wrote: >>> I tried to debug the problem somewhat. In set_append_rel_pathlist(), >>> it finds that at least one child has a parameterized path as the >>> cheapest path, so it doesn't create an unparameterized path for append >>> rel. At the same time there is a parameterization common to all the >>> children, so it doesn't create any path. There seem to be two problems >>> here >>> 1. The children from second level onwards may not be getting >>> parameterized for lateral references. That seems unlikely but >>> possible. > > Did you check this? We may be missing on creating index scan paths > with parameterization. If we fix this, we don't need to > re-parameterize Append. You're right. How about the attached patch that fixes the problem along these lines? The problem seems to be that multi-level inheritance sets (partitioned tables) are not handled in create_lateral_join_info(), which means that lateral_relids and lateral_referencers of the root relation are not being propagated to the partitions below level 1. I'm getting concerned about one thing though - for a given *regular* inheritance set, the root->append_rel_list would be scanned only once; But for a *partitioned table* inheritance set, it would be scanned for every partitioned table in the set (ie, the root table and internal partitions). Thanks, Amit
Commits
-
Fix typo.
- 03bf59676ea0 10.0 landed
-
Document trigger-firing behavior for inheritance/partitioning.
- e17628145ac3 10.0 landed
-
Fire per-statement triggers on partitioned tables.
- e180c8aa8caf 10.0 landed
-
Set ecxt_scantuple correctly for tuple routing.
- 132488bfee68 10.0 landed
-
Fix interaction of partitioned tables with BulkInsertState.
- b1ecb9b3fcfb 10.0 landed
-
Avoid core dump for empty prepared statement in an aborted transaction.
- ba61a04bc7fe 10.0 cited
-
Fix some problems in check_new_partition_bound().
- 8a8afe2f54c2 10.0 landed
-
Remove unnecessary arguments from partitioning functions.
- 18fc5192a631 10.0 cited
-
Fix reporting of constraint violations for table partitioning.
- f1b4c771ea74 10.0 cited
-
Fix tuple routing in cases where tuple descriptors don't match.
- 2ac3ef7a01df 10.0 cited
-
Invalid parent's relcache after CREATE TABLE .. PARTITION OF.
- 7cd0fd655d68 10.0 landed
-
Doc: improve documentation about inheritance.
- 162477a63d3c 10.0 cited