Re: INSERTS waiting with wait_event is "transactionid" - Mailing list pgsql-performance

From Laurenz Albe
Subject Re: INSERTS waiting with wait_event is "transactionid"
Date
Msg-id e9432992a968a9f43896ee4d08e93cdfdd5473cf.camel@cybertec.at
Whole thread Raw
In response to INSERTS waiting with wait_event is "transactionid"  (Nagaraj Raj <nagaraj.sf@yahoo.com>)
Responses Re: INSERTS waiting with wait_event is "transactionid"
List pgsql-performance
On Thu, 2021-04-08 at 20:14 +0000, Nagaraj Raj wrote:
> We are trying to load data around 1Bil records into one table with INSERT statements
>  (not able to use COPY command) and they are been waiting for a lock and the wait_event
>  is "transactionid", I didn't find any information in the documents. Queries have been
>  waiting for hours.

That means that your statement is stuck behind a row lock.

Row locks are stored on the table row itself and contain the transaction ID.
So the process has to wait until the transaction goes away, which is implemented
as waiting for a lock on the transaction ID.

There must be a long running transaction that locks a row that is needed for
the INSERT.  It could be a row in a different table that is referenced by a
foreign key.

Make that long running transaction go away.  Transactions should never last that long.

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com




pgsql-performance by date:

Previous
From: Nagaraj Raj
Date:
Subject: INSERTS waiting with wait_event is "transactionid"
Next
From: Nagaraj Raj
Date:
Subject: Re: INSERTS waiting with wait_event is "transactionid"