From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jeff Janes <jeff.janes@gmail.com>
Cc: Blake McBride <blake1024@gmail.com>
Cc: pgsql-general <pgsql-general@lists.postgresql.org>
Subject: Re: Trouble incrementing a column
Date: Sun, 24 Nov 2019 20:08:45 -0500
Message-ID: <17712.1574644125@sss.pgh.pa.us> (raw)
In-Reply-To: <CAMkU=1w61H6siZF0f+UTSLp_e8=sM7SNT_aFsk6_8kipRsvQGw@mail.gmail.com>
References: <CABwHSOuxyDcnZ7xhj1uQYT09=94-x6O051x=_iK8hiOXoAgCrA@mail.gmail.com>
<17273.1574545645@sss.pgh.pa.us>
<CAMkU=1w61H6siZF0f+UTSLp_e8=sM7SNT_aFsk6_8kipRsvQGw@mail.gmail.com>
Jeff Janes <jeff.janes@gmail.com> writes:
> On Sat, Nov 23, 2019 at 4:47 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Note that you pay a fairly substantial performance penalty for deferring
>> the check, which is why it isn't the default, even though the SQL spec
>> says it ought to be.
> Do you know what the worst case scenario is for the performance of
> deferring the check to the end of the statement (with deferred initially
> immediate)? Upon testing, I get a penalty of 2 to 5%, which seems pretty
> small, but I might not be testing the most adverse situation. See attached.
Hm, I would have expected more, though not factor-of-10 or anything
like that. But that's just vague recollection from when we put in
the feature. I'm not surprised if the numbers have moved since.
> The main "cost" that prevents from using DII routinely is that they can't
> receive foreign key constraints.
Yeah, that's an issue.
regards, tom lane
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: tgl@sss.pgh.pa.us, jeff.janes@gmail.com, blake1024@gmail.com
Subject: Re: Trouble incrementing a column
In-Reply-To: <17712.1574644125@sss.pgh.pa.us>
References: <CABwHSOuxyDcnZ7xhj1uQYT09=94-x6O051x=_iK8hiOXoAgCrA@mail.gmail.com> <17273.1574545645@sss.pgh.pa.us> <CAMkU=1w61H6siZF0f+UTSLp_e8=sM7SNT_aFsk6_8kipRsvQGw@mail.gmail.com> <17712.1574644125@sss.pgh.pa.us>
* 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