-
Type: Task
-
Status: Closed
-
Priority: Minor
-
Resolution: Fixed
-
Affects Version/s: 5.1.3
-
Fix Version/s: 5.2.0-RC1
-
Component/s: Optimization
-
Labels:None
-
External issue URL:
-
Change Log Message:Improving page load sql
-
Story Points:1
-
External issue ID:1320
-
Copy Issue Key:
-
Patch Instructions:
Currently we have the following SQL (actual ids are not important here) to select/find ID of currently loaded Category.
SELECT CategoryId
FROM Categories
WHERE ( (NamedParentPath = 'index') OR (NamedParentPath = 'Content/index') OR (`Type` = 2 AND CachedTemplate = 'index') ) AND (ThemeId = 8 OR ThemeId = 0)
This can become a problem when you have high number of Categories/Sections (ie. 3K+, but not a problem for small websites) since NamedParentPath is a TEXT field and can't be properly cached.
It would be quite an improvement if we start using Hash (int) column which can be Indexed quite well.
Additionally we might want to INDEX Type field too!