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

Idea: how to catch errors of the "missing index" class #360

Open
mfvanek opened this issue Mar 29, 2024 · 1 comment
Open

Idea: how to catch errors of the "missing index" class #360

mfvanek opened this issue Mar 29, 2024 · 1 comment

Comments

@mfvanek
Copy link
Owner

mfvanek commented Mar 29, 2024

In integration tests, at the very beginning, we set enable_seqscan to off. What will force the scheduler to avoid seq scan, if it has such an opportunity (there is an index)

At the end of the test, we look at the statistics of accesses to the table (for each table, postgres counts the number of seq scans and accesses through indexes). If the number of seq scans is greater than 0, it means that there is not enough index for some SELECT

To check, there is a diagnosis of "Tables with missing indexes"

It's like an alternative https://habr.com/ru/companies/tinkoff/articles/454066/

@mfvanek
Copy link
Owner Author

mfvanek commented May 20, 2024

See also https://github.com/pganalyze/lint

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