From: Andreas Joseph Krogh <andreas@visena.com>
To: David Rowley <david.rowley@2ndquadrant.com>
Cc: Simon Riggs <simon@2ndquadrant.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Sv: Re: Re: Removing INNER JOINs
Date: Fri, 1 Dec 2017 10:32:09 +0100 (CET)
Message-ID: <VisenaEmail.c.f48e036910234fe6.1601168de78@tc7-visena> (raw)
In-Reply-To: <CAKJS1f9fWXZqb7p302MQh9mESCdRnPBd9wn3Ekmn1GEmWEE_Jg@mail.gmail.com>
På fredag 01. desember 2017 kl. 03:53:29, skrev David Rowley <
david.rowley@2ndquadrant.com <mailto:david.rowley@2ndquadrant.com>>:
On 1 December 2017 at 15:34, Andreas Joseph Krogh <andreas@visena.com
<mailto:andreas@visena.com>> wrote: Can someone please explain, in
layman-terms, what the problems with FKs are related to JOIN-removal?
Pretty much what I just wrote after "Unfortunately not," above, although you
asked a few seconds before I sent.
We're able to use UNIQUE INDEXes as proofs to remove LEFT JOINs as (with the
exception of deferred unique indexes) these are updated right away, rather than
deferred until the end of the statement as is the case with NOT DEFERRABLE and
not DEFERRED foreign keys. The fact that the foreign keys do not update the
referenced rows right away means that there is a non-zero window of time that
the constraint is violated, therefore, if a query which is run, or is running
during that time, we could return the incorrect results if we were to remove an
INNER JOIN during the planning of that query.
Hm...
The fact that Oracle has solved this makes me think you guys can solve this
too if you put enough brain-power to it:-)
-- Andreas Joseph Krogh
CTO / Partner - Visena AS
Mobile: +47 909 56 963
andreas@visena.com <mailto:andreas@visena.com>
www.visena.com <https://www.visena.com;
<https://www.visena.com;
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: andreas@visena.com, david.rowley@2ndquadrant.com, simon@2ndquadrant.com
Subject: Re: Removing INNER JOINs
In-Reply-To: <VisenaEmail.c.f48e036910234fe6.1601168de78@tc7-visena>
References: <CAKJS1f9fWXZqb7p302MQh9mESCdRnPBd9wn3Ekmn1GEmWEE_Jg@mail.gmail.com> <VisenaEmail.c.f48e036910234fe6.1601168de78@tc7-visena>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox