Is there any way to determine how many rows a transaction has modified (before the transaction ends)?

by Giacomo Alzetta   Last Updated February 11, 2019 09:06 AM

I have a ~320 million row table on which I run the following query:

UPDATE my_table SET state = TRIM(state)

Needless to say this has been running for 90+ hours (since thursday afternoon) and has not finished yet. Even

I'd like to know, more or less, how many rows it has modified until now. Is there any way to obtain this information from the running transaction?

Trying to search I have found how to determine a rough estimate of how many new rows are being added to a table using the pgstattuple function:

select dead_tuple_count from pgstattuple('my_table');

But this does not seem to show any interesting information for how many rows have been modified.



Related Questions


Updated March 17, 2017 17:06 PM

Updated April 22, 2015 21:02 PM

Updated May 25, 2016 09:02 AM

Updated January 31, 2017 15:02 PM

Updated September 30, 2018 22:06 PM