Re: Long running query causing XID limit breach - Mailing list pgsql-general

From yudhi s
Subject Re: Long running query causing XID limit breach
Date
Msg-id CAEzWdqc9gwq0KwqkaZJ9hVH4bhP_RdKPVWsqzA=a8cOh_Njj=g@mail.gmail.com
Whole thread Raw
In response to Re: Long running query causing XID limit breach  (sud <suds1434@gmail.com>)
List pgsql-general

On Thu, May 23, 2024 at 11:42 AM sud <suds1434@gmail.com> wrote:

Calculation Rationale
Daily XID Usage: Approximately 4 billion rows per day implies high XID consumption.
Buffer Time: At 1 billion XIDs, you would still have 1 billion XIDs remaining, giving you roughly 12 hours to address the issue if your system consumes 200 million XIDs per hour.




OP mentioned that initially the number of business transactions is around 500million but the rows inserted across many tables are ~4-5billion in total per day. So doesn't it mean that the XID consumption will happen based on the transactions rather on the number of rows basis. Say for example ~4billion rows may be loaded using a batch size of ~1000 using bulk load, so that will be ~4million txn so it should use ~4million XID but not 4 billion XID usage. And thus making the transactions process in batches rather than row by row minimizes the XID usage. Correct? 

pgsql-general by date:

Previous
From: "Peter J. Holzer"
Date:
Subject: expected authentication request from server, but received H
Next
From: Laurenz Albe
Date:
Subject: Re: Long running query causing XID limit breach