Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid toast index #375

Open
blogh opened this issue Feb 4, 2025 · 1 comment
Open

Invalid toast index #375

blogh opened this issue Feb 4, 2025 · 1 comment

Comments

@blogh
Copy link
Collaborator

blogh commented Feb 4, 2025

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

@blogh
Copy link
Collaborator Author

blogh commented Feb 4, 2025

Note: If there is an agreement on what to do, I can make the patch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant