Re: partitioned tables referenced by FKs

Jesper Pedersen <jesper.pedersen@redhat.com>

From: Jesper Pedersen <jesper.pedersen@redhat.com>
To: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>, Pg Hackers <pgsql-hackers@postgresql.org>
Date: 2019-03-22T13:01:34Z
Lists: pgsql-hackers
Hi Alvaro,

On 3/21/19 6:18 PM, Alvaro Herrera wrote:
> On 2019-Mar-21, Jesper Pedersen wrote:
>> pgbench -M prepared -f select.sql ....
>>
>> I'm seeing 82.64% spent in GetCachedPlan(). plan_cache_mode is auto.
> 
> Hmm, I can't reproduce this at all ...  I don't even see GetCachedPlan
> in the profile.  Do you maybe have some additional patch in your tree?
> 

No, with 7df159a62 and v7 compiled with "-O0 -fno-omit-frame-pointer" I 
still see it.

plan_cache_mode = auto
   2394 TPS w/ GetCachePlan() @ 81.79%

plan_cache_mode = force_generic_plan
  10984 TPS w/ GetCachePlan() @ 23.52%

perf sent off-list.

Best regards,
  Jesper


Commits

  1. Support foreign keys that reference partitioned tables

  2. Fix partitioned index creation bug with dropped columns

  3. Improve psql's \d display of foreign key constraints

  4. Fix dependency recording bug for partitioned PKs

  5. Add index_get_partition convenience function

  6. Restore RI trigger sanity check

  7. Foreign keys on partitioned tables