Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Reverts #682
I'm investigating some performance issues and I found out this PR while looking into this repo.
I think this PR should be reverted because it creates some useless indexes and the other created indexes will likely never be used and only increases tag creation times.
By going into details
This is already provided by this line as leftmost prefix of an existing index
This is redundant because is a left prefix of the index below and also already provided by this index
These two index as is may provide some benefits if one is doing some sort of stats (e.g. tags vs keywords, etc) but I don't think they should be added by default.
Left prefix of below index
This is the only truly missing index and can be useful if one wants to show user tagged elements.
This is already provided by this migration, it only add additional columns. If this is going to be added then the other should be removed in favor of this.
In conclusion in my opinion #682 as is should be reverted. Maybe a good replacement would only include
a commented index for
taggable_type
andcontext
explaining that it can be useful only to do some stats and a commented version ofadd_index :taggings, [:tagger_id, :tagger_type]
that explain its usage.In this way upgrading users will not add them blindly only because it's description says "Add missing indexes".
What do you think?