Postgres pg_toast in autovacuum - which table?

前端 未结 2 1431
我在风中等你
我在风中等你 2021-02-12 23:57

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_154045         


        
相关标签:
2条回答
  • 2021-02-13 00:26

    Here's a shorter way:

    select 15404513::regclass;
    

    where 15404513 is pg_toast_ suffix.

    0 讨论(0)
  • 2021-02-13 00:32

    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') )
    

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

    0 讨论(0)
提交回复
热议问题