Re: More efficient RI checks - take 2

From: Antonin Houska <ah(at)cybertec(dot)at>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: More efficient RI checks - take 2
Date: 2020-06-05 15:16:43
Message-ID: 65467.1591370203@antos
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Antonin Houska <ah(at)cybertec(dot)at> wrote:

> In general, the checks are significantly faster if there are many rows to
> process, and a bit slower when we only need to check a single row.

Attached is a new version that uses the existing simple queries if there's
only one row to check. SPI is used for both single-row and bulk checks - as
discussed in this thread, it can perhaps be replaced with a different approach
if appears to be beneficial, at least for the single-row checks.

I think using a separate query for the single-row check is more practicable
than convincing the planner that the bulk-check query should only check a
single row. So this patch version tries to show what it'd look like.

Antonin Houska

Attachment Content-Type Size
v02-0001-Check-for-RI-violation-outside-ri_PerformCheck.patch text/x-diff 2.4 KB
v02-0002-Changed-ri_GenerateQual-so-it-generates-the-whole-qu.patch text/x-diff 20.2 KB
v02-0003-Return-early-from-ri_NullCheck-if-possible.patch text/x-diff 1011 bytes
v02-0004-Introduce-infrastructure-for-batch-processing-RI-eve.patch text/x-diff 86.4 KB
v02-0005-Process-multiple-RI-trigger-events-at-a-time.patch text/x-diff 42.7 KB

In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2020-06-05 15:20:52 Re: WIP: WAL prefetch (another approach)
Previous Message PG Doc comments form 2020-06-05 14:31:34 create database with template doesn't copy ACL