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

Add check "Do not index booleans" #322

Closed
mfvanek opened this issue Nov 29, 2023 · 3 comments
Closed

Add check "Do not index booleans" #322

mfvanek opened this issue Nov 29, 2023 · 3 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@mfvanek
Copy link
Owner

mfvanek commented Nov 29, 2023

Extracted from #45

See the article by Kirill Borovikov posted on Habr https://habr.com/ru/companies/tensor/articles/488104/
Part "Bad: too little (boolean)".

  1. Add new sql-query to https://github.com/mfvanek/pg-index-health-sql
  2. Then implement new check with tests
  3. After that add example to demo apps
@mfvanek mfvanek added enhancement New feature or request good first issue Good for newcomers labels Nov 29, 2023
@mfvanek mfvanek changed the title Add check "Do not index boleans" Add check "Do not index booleans" Nov 30, 2023
@Evreke
Copy link
Collaborator

Evreke commented Jan 13, 2024

Here is prototype of request that select indexes with boolean type in it.

select -- pn.nspname,
       pi.indrelid::regclass::text   as table_name,
       pi.indexrelid::regclass::text as index_name,
       col.attname                   as column_name,
       col.attnotnull                as column_not_null
-- col.atttypid::regtype::text   as column_type
from pg_catalog.pg_index pi
         join pg_catalog.pg_class pc on pc.oid = pi.indexrelid
         join pg_catalog.pg_namespace pn on pn.oid = pc.relnamespace
         join pg_catalog.pg_attribute col on col.attrelid = pi.indrelid and col.attnum = any (pi.indkey)
where pn.nspname = 'public'::text
  and NOT pi.indisunique
  AND pi.indisready
  AND pi.indisvalid
  AND col.atttypid = 'boolean'::regtype
order by table_name, index_name;

Evreke added a commit to mfvanek/pg-index-health-sql that referenced this issue Feb 6, 2024
Query to check on indexes with boolean values.
Evreke added a commit to mfvanek/pg-index-health-sql that referenced this issue Feb 6, 2024
Fix formatting.
Add header and description.
Evreke added a commit to mfvanek/pg-index-health-sql that referenced this issue Feb 6, 2024
Fix formatting.
Add header and description.
mfvanek pushed a commit to mfvanek/pg-index-health-sql that referenced this issue Feb 6, 2024
* mfvanek/pg-index-health#322

Query to check on indexes with boolean values.

* mfvanek/pg-index-health#322

Fix formatting.
Add header and description.
@Evreke
Copy link
Collaborator

Evreke commented Apr 15, 2024

I'm going to implement this feature this week. Sorry for delay.

@mfvanek
Copy link
Owner Author

mfvanek commented Apr 28, 2024

Need to

  • update readme
  • update spring boot starter
  • add sample to the demo apps

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

No branches or pull requests

2 participants