Hi
This is tested but only works when the load is very low.
To fix the problem with xmin we use this
https://gitlab.com/nibioopensource/postgres_execute_parallel to start the jobs, but the control is returned to the caller at given intervals, and the caller also does a commit and gets a new snapshot and xmin is updated. If all jobs done are done the caller
may start a new batch of jobs.
One of the 750 jobs takes for hours to remove (https://postgis.net/docs/ST_RemEdgeNewFace.html) almost 30.000 edges. I do this
in a loop takes around 500 edges in every loop. If the time used is to long I forced a commit in this loop in addition to the analyze I do. Adding the commit really helps on execution time but only when running a very few jobs in parallel. With this new commit
I could see that dead rows were removed.
The issue with the new commit in the loop where I remove edges is that it becomes problem when many treads run parallel related to subtransactions per transaction
like discussed here
https://postgrespro.com/list/thread-id/2478202 and many other threads. Almost like a catch 22, fixing the dead rows problem is causing a new bigger problem.
So to solve problems with subtransactions per transaction I can make new joblist for removing edges also, but that makes things more complicated.
Thanks
Lars.
|