Re: In progress INSERT wrecks plans on table

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Mark Kirkwood <mark(dot)kirkwood(at)catalyst(dot)net(dot)nz>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Gavin Flower <gavinflower(at)archidevsys(dot)co(dot)nz>, "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: In progress INSERT wrecks plans on table
Date: 2013-05-04 12:49:39
Message-ID: CA+U5nMKMfZUEimZ9=oF2wJ-WkiGhMw3mQjUFT6PBGofUpmXL8A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-performance

On 3 May 2013 13:41, Simon Riggs <simon(at)2ndquadrant(dot)com> wrote:

> (3) to make the check on TransactionIdIsInProgress() into a heuristic,
> since we don't *need* to check that, so if we keep checking the same
> xid repeatedly we can reduce the number of checks or avoid xids that
> seem to be long running. That's slightly more coding than my quick
> hack here but seems worth it.
>
> I think we need both (1) and (3) but the attached patch does just (1).
>
> This is a similar optimisation to the one I introduced for
> TransactionIdIsKnownCompleted(), except this applies to repeated
> checking of as yet-incomplete xids, and to bulk concurrent
> transactions.

ISTM we can improve performance of TransactionIdIsInProgress() by
caching the procno of our last xid.

Mark, could you retest with both these patches? Thanks.

--
Simon Riggs http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

Attachment Content-Type Size
cache_TransactionIdInProgress.v1.patch application/octet-stream 4.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Marti Raudsepp 2013-05-04 12:50:34 Re: 9.3 release notes suggestions
Previous Message Ian Lawrence Barwick 2013-05-04 11:34:18 Re: 9.3 release notes suggestions

Browse pgsql-performance by date

  From Date Subject
Next Message Mark Kirkwood 2013-05-06 01:51:50 Re: In progress INSERT wrecks plans on table
Previous Message Anne Rosset 2013-05-03 20:52:19 Re: Deterioration in performance when query executed in multi threads