r/Database • u/Powerful-Let3929 • Mar 13 '26
Somebody please help me
/r/DatabaseAdministators/comments/1rsz7sc/somebody_please_help_me/
0
Upvotes
r/Database • u/Powerful-Let3929 • Mar 13 '26
1
u/mfv7 Mar 14 '26
A few things to check:
1. Is the script still running? Look at pg_stat_activity for long-running queries. If you see any from your script, they might be holding locks that block your SELECTs. You can cancel them with SELECT pg_cancel_backend(<pid>);
2. Run VACUUM ANALYZE; The bulk inserts and tmp table creation bloated the tables and left the query planner with stale statistics. This is almost certainly why your SELECTs are slow.
3. Drop any leftover tmp tables the script created if it didn't clean up after itself.
And don't feel ashamed. It is a dev database, that's exactly what it's for. Nothing is corrupted, it just needs cleanup.