Re: In progress INSERT wrecks plans on table

From: Mark Kirkwood <mark(dot)kirkwood(at)catalyst(dot)net(dot)nz>
To: Simon Riggs <simon(at)2ndQuadrant(dot)com>
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-06 01:51:50
Message-ID: 51870CB6.6090404@catalyst.net.nz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-performance

On 05/05/13 00:49, Simon Riggs wrote:
> 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.
>

Thanks Simon, will do and report back.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2013-05-06 05:47:17 Re: Meaning of keyword category list in src/backend/parser/gram.y
Previous Message Stephen Frost 2013-05-06 00:01:35 Re: pg_dump versus materialized views

Browse pgsql-performance by date

  From Date Subject
Next Message Yuri Levinsky 2013-05-06 06:51:02 Re: Hardware suggestions for maximum read performance
Previous Message Simon Riggs 2013-05-04 12:49:39 Re: In progress INSERT wrecks plans on table