-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Labels
PerformanceProblems with performanceProblems with performance
Milestone
Description
The current smart content filter queries can be very slow because of usage of distinct:
With Distinct and Join 1.37s:
SELECT DISTINCT k0_.id AS id_0,
k1_.workflowPublished as workflow_published_1
FROM kgr_recipes k0_
INNER JOIN kgr_recipe_dimension_contents k1_ ON k0_.id = k1_.recipeId
INNER JOIN kgr_recipe_dimension_content_excerpt_categories k3_ ON k3_.recipe_dimension_content_id = k1_.id
WHERE k1_.stage = 'live' AND k1_.locale = 'de'
AND k3_.category_id IN (165, 144)
-- AND (
-- SELECT k3_.category_id FROM kgr_recipe_dimension_content_excerpt_categories k3_
-- WHERE k3_.recipe_dimension_content_id = k1_.id AND k3_.category_id IN (165, 144)
-- LIMIT 1
-- ) != 0
ORDER BY k1_.workflowPublished DESC LIMIT 33Without Join and without distinct 83ms:
SELECT k0_.id AS id_0,
k1_.workflowPublished as workflow_published_1
FROM kgr_recipes k0_
INNER JOIN kgr_recipe_dimension_contents k1_ ON k0_.id = k1_.recipeId
-- INNER JOIN kgr_recipe_dimension_content_excerpt_categories k3_ ON k3_.recipe_dimension_content_id = k1_.id -- AND k3_.category_id IN (165, 144)
WHERE k1_.stage = 'live' AND k1_.locale = 'de'
-- AND k3_.category_id IN (165, 144)
AND (
SELECT k3_.category_id FROM kgr_recipe_dimension_content_excerpt_categories k3_
WHERE k3_.recipe_dimension_content_id = k1_.id AND k3_.category_id IN (165, 144)
LIMIT 1
) != 0
ORDER BY k1_.workflowPublished DESC LIMIT 33This impacts:
Metadata
Metadata
Assignees
Labels
PerformanceProblems with performanceProblems with performance