Re: [HACKERS] Runtime Partition Pruning
David Rowley <david.rowley@2ndquadrant.com>
From: David Rowley <david.rowley@2ndquadrant.com>
To: Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Cc: Rajkumar Raghuwanshi <rajkumar.raghuwanshi@enterprisedb.com>, Beena Emerson <memissemerson@gmail.com>,
Alvaro Herrera <alvherre@alvh.no-ip.org>, Robert Haas <robertmhaas@gmail.com>, amul sul <sulamul@gmail.com>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>,
Dilip Kumar <dilipbalaut@gmail.com>
Date: 2018-02-23T11:34:19Z
Lists: pgsql-hackers
Attachments
- v12-0001-Add-bms_prev_member-function.patch (application/octet-stream) patch v12-0001
- v12-0002-Allow-partition-elimination-to-occur-during-exec.patch (application/octet-stream) patch v12-0002
- v12-0003-Pre-process-OR-clauses-and-store-in-the-Partitio.patch (application/octet-stream) patch v12-0003
On 22 February 2018 at 22:31, Amit Langote <Langote_Amit_f8@lab.ntt.co.jp> wrote: > Some comments: > > * I noticed that the patch adds a function to bitmapset.c which you might > want to extract into its own patch, like your patch to add bms_add_range() > that got committed as 84940644d [2]. I've made that 0001 in the series > * Maybe it's better to add `default: break;` in the two switch's > you've added in partkey_datum_from_expr() > > partprune.c: In function ‘partkey_datum_from_expr’: > partprune.c:1555:2: warning: enumeration value ‘T_Invalid’ not handled in > switch [-Wswitch] > switch (nodeTag(expr)) > > partprune.c:1562:4: warning: enumeration value ‘PARAM_SUBLINK’ not handled > in switch [-Wswitch] > switch (((Param *) expr)->paramkind) I wasn't aware of that gcc flag. I was also surprised to see a clean compile from master with it enabled. This area has been changed a bit from the last patch, but the remaining switch now has a default: return false; > * I see that you moved PartitionClauseInfo's definition from partprune.c > to partition.h. Isn't it better to move it to partprune.h? Moved. I'd done it the other way to try to reduce the number of planner headers included in the executor, but will defer to your better judgement, as I see you're busy working on improving this area in another patch set. I've attached an updated set of patches. I hope this also addresses Rajkumar reported crash. I ended up making some changes to how the Param values are determined by reusing more of the existing executor code rather than duplicating it in partkey_datum_from_expr. I really could use a sanity check on my changes to that function now, especially the cross type portion. -- David Rowley http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services
Commits
-
Initialize ExprStates once in run-time partition pruning
- 1957f8dabf8d 11.0 landed
-
Add bms_prev_member function
- 5c0675215e15 11.0 landed
-
Support partition pruning at execution time
- 499be013de65 11.0 landed
-
Document partprune.c a little better
- 971d7ddbe19a 11.0 landed
-
Fix crash in pg_replication_slot_advance
- 6f1d723b6359 11.0 cited
-
Add parallel-aware hash joins.
- 1804284042e6 11.0 cited
-
Fix typo.
- 487a0c1518af 11.0 cited
-
Allow --with-bonjour to work with non-macOS implementations of Bonjour.
- 9b9cb3c4534d 11.0 cited
-
Mention need for --no-inc-recursive in rsync command
- 2c74e6c1dcc5 11.0 cited