Re: improving foreign key locks

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Florian Pflug <fgp(at)phlo(dot)org>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: improving foreign key locks
Date: 2010-11-29 21:33:19
Message-ID: 4806.1291066399@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Alvaro Herrera <alvherre(at)commandprompt(dot)com> writes:
> Excerpts from Alvaro Herrera's message of lun nov 29 18:00:55 -0300 2010:
>> 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.

Checking for existence of a unique index at parse analysis time is quite
horrid anyway, because it means the validity of the query can change
from parse time to execution time. We got stuck with some of that in
relation to GROUP BY dependencies, but I don't want to buy into it
anywhere that we're not forced to by the letter of the SQL spec.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

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