Re: [EXT] Re: Troubleshooting a long running delete statement

2021-10-07 Thread Corey Huinker
> > > > This won't be immediately useful, but there's been a patch proposed for > Postgres 15 to allow logging the plan of a running query [1]. Progress > seems to have stalled a bit, but it seems like there was a fair amount of > interest, so I wouldn't count it out yet. If you have thoughts on th

Re: [EXT] Re: Troubleshooting a long running delete statement

2021-10-06 Thread Maciek Sakrejda
On Wed, Oct 6, 2021 at 1:32 PM Dirschel, Steve < steve.dirsc...@thomsonreuters.com> wrote: > Thanks for the reply and the info above. My question was more directed at > how can you troubleshoot the active session running the query. In the > examples above you are actually executing the query. I

Re: [EXT] Re: Troubleshooting a long running delete statement

2021-10-06 Thread Mladen Gogala
On 10/6/21 16:32, Dirschel, Steve wrote: postgres=# explain (analyze) delete from t;  Delete on t I would try explain (analyze, timing, buffers). That would also give you the timing of each step so you can figure which one takes the longes. Regards -- Mladen Gogala Database Consultant Tel

Re: [EXT] Re: Troubleshooting a long running delete statement

2021-10-06 Thread Mladen Gogala
On 10/6/21 16:26, Dirschel, Steve wrote: Thanks for the reply and I hope I’m replying to this e-mail correctly at the bottom of the chain. Hey, it's not me, it's rules and regulations. And that's incredibly important on this group, or so I was lead to believe :) We are running on AWS auror

RE: [EXT] Re: Troubleshooting a long running delete statement

2021-10-06 Thread Dirschel, Steve
On Wed, Oct 06, 2021 at 06:00:07PM +, Dirschel, Steve wrote: > • When I did an explain on the delete I could see it was full scanning the table. I did a full scan of the table interactively in less than 1 second so the long runtime was not due to the full tablescan.

RE: [EXT] Re: Troubleshooting a long running delete statement

2021-10-06 Thread Dirschel, Steve
On 10/6/21 14:00, Dirschel, Steve wrote: Question: How would one troubleshoot this issue in Postgres as to why the delete was running so long? My background is Oracle and there are various statistics I may look at: · One could estimate the number of logical reads the delete should do