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 for overlapping indices #114

Merged
merged 1 commit into from
Sep 3, 2024

Conversation

Raveline
Copy link
Contributor

This PR adds a check for overlapping indexes. As this is relatively tricky to write in haskell, we rely upon a query provided by @marco44 (the query and the comments are his, not mine). The main problem with this is that we have to run a query during the checks in order to get the required information, which makes the checking function a bit more convoluted. Apologies.

Output looks like this:

2024-08-30 14:20:14 ATTENTION hpqtypes-extras-test: Some indexes are overlapping

  ●  Index CREATE INDEX idx__idxtest__idx1__idx2 ON public.idxtest USING btree (idx1, idx2) contains index CREATE INDEX idx__idxtest__idx1 ON public.idxtest USING btree (idx1)

@@ -16,6 +16,8 @@ data ExtrasOptions =
-- the one in the code definition.
, eoCheckForeignKeysIndexes :: !Bool
-- ^ Check if all foreign keys have indexes.
, eoCheckOverlappingIndexes :: !Bool
-- ^ Check if some index are redundant
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
-- ^ Check if some index are redundant
-- ^ Check if some indexes are redundant.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed !

@arybczak
Copy link
Collaborator

arybczak commented Sep 3, 2024

Looks good 👍

@Raveline Raveline force-pushed the add-overlapping-index-detection branch from 5d74d9c to 12ffff6 Compare September 3, 2024 17:07
@Raveline Raveline merged commit 165b6ac into master Sep 3, 2024
7 checks passed
@Raveline Raveline deleted the add-overlapping-index-detection branch September 3, 2024 17:14
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

Successfully merging this pull request may close these issues.

2 participants