本文介绍了Postvacs pg_toast在autovacuum中-哪个表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在pg_toast上运行了一个自动清理过程:

I have an autovacuum process running on pg_toast:

select query, from pg_stat_activity where query like '%autov%';
"autovacuum: VACUUM pg_toast.pg_toast_15404513 "

我如何找出表/索引/这个pg_toast涉及什么?还是autovacuum在其他方面起作用?

How do I find out what table/index/whatever this pg_toast pertains to? Or is the autovacuum working on something else?

推荐答案

我想您会想要类似的东西:

I think you'll want something like:

select n.nspname, c.relname 
from pg_class c 
inner join pg_namespace n on c.relnamespace = n.oid
where reltoastrelid = (
    select oid
    from pg_class 
    where relname = 'pg_toast_15404513' 
    and relnamespace = (SELECT n2.oid FROM pg_namespace n2 WHERE n2.nspname = 'pg_toast') )

如果Pg在vacuum命令摘要中报告了这一点,那就太好了。

It'd be nice if Pg reported this in the vacuum command summary.

这篇关于Postvacs pg_toast在autovacuum中-哪个表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 02:45