Re: Trouble incrementing a column

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Blake McBride <blake1024(at)gmail(dot)com>, pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Trouble incrementing a column
Date: 2019-11-25 00:51:11
Message-ID: CAMkU=1w61H6siZF0f+UTSLp_e8=sM7SNT_aFsk6_8kipRsvQGw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sat, Nov 23, 2019 at 4:47 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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.

The main "cost" that prevents from using DII routinely is that they can't
receive foreign key constraints.

Cheers,

Jeff

Attachment Content-Type Size
bench_dii.sh text/x-sh 707 bytes

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2019-11-25 01:08:45 Re: Trouble incrementing a column
Previous Message Tom Lane 2019-11-24 15:35:43 Re: here does postgres take its timezone information from?