Re: [HACKERS] Runtime Partition Pruning

Jesper Pedersen <jesper.pedersen@redhat.com>

From: Jesper Pedersen <jesper.pedersen@redhat.com>
To: David Rowley <david.rowley@2ndquadrant.com>
Cc: Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>, 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-04-03T17:44:37Z
Lists: pgsql-hackers

Attachments

Hi David,

On 03/31/2018 09:52 AM, David Rowley wrote:
> I've attached a new version of the patch.  I'm now at v18 after having
> some versions of the patch that I didn't release which were based on
> various versions of Amit's faster partition pruning patch.
> 

Thank you for the updated patch set !

I have tested this together with Amit's v46 patch.

The attached case doesn't trigger a generic plan, so basically all time 
is spent in GetCachedPlan.

The standard table case (std.sql) gives:

  generic_cost = 8.4525
  avg_custom_cost = 13.4525
  total_custom_cost = 67.2625

whereas the 64 hash partition case (hash.sql) gives:

  generic_cost = 540.32
  avg_custom_cost = 175.9425
  total_custom_cost = 879.7125

I tested with pgbench -M prepared -f select.sql.

Also, I'm seeing a regression for check-world in 
src/test/regress/results/inherit.out

***************
*** 642,648 ****
   ---------------------+---+---+-----
    mlparted_tab_part1  | 1 | a |
    mlparted_tab_part2a | 2 | a |
!  mlparted_tab_part2b | 2 | b | xxx
    mlparted_tab_part3  | 3 | a | xxx
   (4 rows)

--- 642,648 ----
   ---------------------+---+---+-----
    mlparted_tab_part1  | 1 | a |
    mlparted_tab_part2a | 2 | a |
!  mlparted_tab_part2b | 2 | b |
    mlparted_tab_part3  | 3 | a | xxx
   (4 rows)

I'll spend some more time tomorrow.

Thanks for working on this !

Best regards,
  Jesper

Commits

  1. Initialize ExprStates once in run-time partition pruning

  2. Add bms_prev_member function

  3. Support partition pruning at execution time

  4. Document partprune.c a little better

  5. Fix crash in pg_replication_slot_advance

  6. Add parallel-aware hash joins.

  7. Fix typo.

  8. Allow --with-bonjour to work with non-macOS implementations of Bonjour.

  9. Mention need for --no-inc-recursive in rsync command