Redshift截断表的操作被挂起,并且没有其他正在运行的查询。

0

【以下的问题经过翻译处理】 每隔几个月,我会收到一个截断表命令,它会一直挂起然后死掉。它不会发生在同一张表上,并且当我检查其他正在运行的查询时,除了截断命令之外没有其它的了(也就是select * from stv_recents where status<>'Done')。我需要重新启动服务器才能让它运行。如何确定哪些进程实际上正在锁定该表?

profile picture
专家
已提问 5 个月前37 查看次数
1 回答
0

【以下的回答经过翻译处理】 这里是我用来调查的几个查询:

select t.relname,pid,mode,granted from pg_locks l, pg_stat_all_tables t where l.relation=t.relid order by relation asc;

select distinct(relation) table_id ,xid ,pid ,txn_start ,lock_mode ,trim(nspname) schema_name ,trim(relname) table_name from svv_transactions left join pg_class on pg_class.oid = svv_transactions.relation join pg_namespace on pg_namespace.oid = relnamespace;

你也可以使用stv_locks。

profile picture
专家
已回答 5 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则