Re: improving foreign key locks

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Florian Pflug <fgp(at)phlo(dot)org>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: improving foreign key locks
Date: 2010-11-29 21:12:56
Message-ID: 1291065111-sup-2613@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Excerpts from Alvaro Herrera's message of lun nov 29 18:00:55 -0300 2010:

> This would require some additions in ri_FetchConstraintInfo(). Right
> now it does a single syscache lookup and then extracts a bunch of
> attributes from there. If we're going to implement as you suggest, we'd
> have to:
>
> 1. add a relcache lookup in there, and extract column names involved in
> the FK.
>
> 2. store those column names in RI_ConstraintInfo; currently it's about
> 68 bytes, it'd grow to ~2116 bytes (current size plus RI_MAX_NUMKEYS * NAMEDATALEN).
>
> Additionally, we'd have to expend some more cycles at the parse analysis
> phase (of the "FOR SHARE OF x.col1, x.col2" query) to verify that those
> columns belong into some non-partial unique index.

Hmm, actually there's already a relcache lookup when we execute whatever
action the FK needs to execute, so maybe we don't need to do any of
this.

--
Álvaro Herrera <alvherre(at)commandprompt(dot)com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Fetter 2010-11-29 21:14:54 Re: Re: [COMMITTERS] pgsql: Remove outdated comments from the regression test files.
Previous Message Alvaro Herrera 2010-11-29 21:00:55 Re: improving foreign key locks