Skip to content

Invalid toast index #375

@blogh

Description

@blogh

Hi,

Currently, we skip the pg_toast% schema in the invalid index detection service.

One of our customers performs REINDEX SCHEMA maintenance, which rebuilds toast indexes.
As a result, the service missed several invalid indexes in their database.

    SELECT current_database(), nsp.nspname AS schemaname, cls.relname, idx.indisvalid
        FROM pg_class cls
            join pg_namespace nsp on nsp.oid = cls.relnamespace
            join pg_index idx on idx.indexrelid = cls.oid
        WHERE
            cls.relkind = 'i'
        AND nsp.nspname not like 'pg_toast%'
        AND nsp.nspname NOT IN ('information_schema', 'pg_catalog');
    };

Can we remove the toast filter?

SELECT current_database(), nsp.nspname AS schemaname, cls.relname, idx.indisvalid

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions