I have a query running in Postgres 9.3 for more than 24h now (namely an EXPLAIN ANALYZE VERBOSE, linked to another question).
I check the "Server status" in pgAdmin which shows the query "Active". I ran some standard lock detection but it didn't return anything.
I'm not sure why it's taking so long: is it waiting for a lock that it can never get (no point in waiting)? Is it just slow (let it run longer)?
In case it's relevant, the database itself is quite big (500 million rows on one of the foreign table, several millions on others) and the data directory uses 240 out of the 340 GB of the disk, so has ~100 GB left. It is a Windows 2012 Server with 12 GB RAM, 6 GB left.
EDIT: The query itself finally finished after 28h30 (because of recursive-like delete), but the question is still valid: what can I check to make sure I'm not waiting in vain? (removed postgresql-9.3 because it would be better to have a more general answer)
wait_event_typeshow you? You could also use the functionpg_blocking_pids()to get a list of other transactions that are blocking your query (in case it's blocked)select * from pg_stat_activity? I think it was introduced in 9.6 and I'm running 9.3... I ran the query again (it finished it that case, after 28h30) and the only interesting column I could see iswaiting=false.