You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is the actual query on this field only or the two fields of this table. Can you point to the line of code that does the query?
If it's using the two of them (as I would expect) then we need to include both fields in the index. We might also need two indexes btw.
Then I edited a ContentItem containing tags and I got the following SQL query in my log:
SELECT tags0_.TagsPartRecord_id as TagsPart3_2_, tags0_.Id as Id2_, tags0_.Id as Id561_1_,
tags0_.TagRecord_id as TagRecord2_561_1_, tags0_.TagsPartRecord_id as TagsPart3_561_1_,
tagrecord1_.Id as Id562_0_, tagrecord1_.TagName as TagName562_0_
FROM Orchard_Tags_ContentTagRecord tags0_
left outer join Orchard_Tags_TagRecord tagrecord1_ on tags0_.TagRecord_id=tagrecord1_.Id
WHERE tags0_.TagsPartRecord_id=@p0; @p0 = 1837 [Type: Int32 (0)]
Here the only where condition is on field TagsPartRecord_id.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Added index on field TagsPartRecord_Id in table ContentTagRecord for performance enhancement.
See issue #7590.