postgresql – Postgres pg_toast在autovacuum – 哪个表?

前端之家收集整理的这篇文章主要介绍了postgresql – Postgres pg_toast在autovacuum – 哪个表?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我有一个在pg_toast上运行的autovacuum进程:
select query,from pg_stat_activity where query like '%autov%';
"autovacuum: VACUUM pg_toast.pg_toast_15404513 "

我如何找到什么表/索引/这pg_toast属于什么?还是自动真空工作在别的什么?

我想你会想要这样的东西:
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在真空指令摘要中报告了这一点,这将是很好的.

原文链接:https://www.f2er.com/postgresql/192614.html

猜你在找的Postgre SQL相关文章