We tested the plugin against our Large Database (e.g. 100K categories) there was a slight performance issue. It took a few seconds to load. It's b
The issue is the HTML build of the Category dropdown. NOP takes time. We've solve the issue on some of our own plugins. We use a stored procedure to generate the hierarchy instead of using code.
Sharing this SQL statement:
;WITH cteCategoryHierarchy AS
(
SELECT Id,
HierarchicalPath = CAST(' >> '+ [Name] AS VARCHAR(4000)),
[Name]
FROM dbo.Category
WHERE ParentCategoryId = 0 and Deleted = 0
UNION ALL
SELECT c1.Id,
HierarchicalPath = CAST(ch.HierarchicalPath + ' >> '+ c1.[Name] AS VARCHAR(4000)),
c1.[Name]
FROM dbo.Category c1
INNER JOIN cteCategoryHierarchy ch ON c1.ParentCategoryId = ch.Id
WHERE c1.Deleted = 0
)
SELECT
RIGHT(HierarchicalPath, LEN(HierarchicalPath) - 4) as [Text],
Id as [Value]
FROM cteCategoryHierarchy
ORDER BY HierarchicalPath
--for JSON PATH
It's actually very fast. If you are using JSON for passing the data back as an object, just uncomment the the last line and the JSON data will be prebuilt by SQL.
Thanks for all the help.