Re: Undetected Deadlock - Mailing list pgsql-general

From Michael Harris
Subject Re: Undetected Deadlock
Date
Msg-id CADofcAVRwzHnkvY9W370Qm9xiRJ0ttrvSkMK_DSx15TDyT=SVA@mail.gmail.com
Whole thread Raw
In response to Re: Undetected Deadlock  (Michael Lewis <mlewis@entrata.com>)
Responses Re: Undetected Deadlock  (Michael Lewis <mlewis@entrata.com>)
List pgsql-general
> I must be missing something. You mentioned dropping a partition, so is there an actual need for the delete? Could you
detachconcurrently and then drop the table or delete rows if needed?
 

The DELETE is part of a transaction performing data loading. Our
application allows data to be overwritten. Before using a COPY to
actually store the new data, we do a DELETE to make sure there are no
existing records. We tested a number of sequences and found that the
most efficient is to perform a DELETE first, even though in most cases
there is nothing to delete, and then do the COPY (rather than for
example checking if it exists first and then deleting it).

The DROP is part of a separate transaction that is doing the data
expiry. Note that it is not dropping the same partition; old
partitions get dropped, new data is loaded into newer partitions.

Cheers
Mike



pgsql-general by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: PostgreSQL Management and monitoring tool
Next
From: Michael Lewis
Date:
Subject: Re: Undetected Deadlock