'QUERY' => 'SELECT d0_.id AS id_0, d0_.rank AS rank_1 FROM d_product d0_ LEFT JOIN d_product_stock d1_ ON d0_.stock_id = d1_.id LEFT JOIN d_product_categories_all d3_ ON d0_.id = d3_.product_id LEFT JOIN structure_node s2_ ON s2_.id = d3_.structure_node_id JOIN (SELECT d0_.root_id AS root_id, d0_.id AS id_0, MAX(d0_.rank) AS rank_1 FROM d_product d0_ LEFT JOIN d_product_stock d1_ ON d0_.stock_id = d1_.id LEFT JOIN d_product_categories_all d3_ ON d0_.id = d3_.product_id LEFT JOIN structure_node s2_ ON s2_.id = d3_.structure_node_id WHERE d0_.root_id NOT IN ( '?*??ݳ??Mz??', '?*?V1?????z??', '??F??Ld?V?z??') AND d0_.visible = 1 AND s2_.id = 340 AND d1_.internal_amount <= 0 GROUP BY d0_.root_id) subq ON subq.root_id = d0_.root_id WHERE subq.rank_1 = d0_.rank AND d0_.root_id NOT IN ( '?*??ݳ??M?z??', '?*?V1?????z??', '??F??Ld?V?z??') AND d0_.visible = 1 AND s2_.id = 340 AND d1_.internal_amount <= 0 GROUP BY d0_.root_id ORDER BY d0_.purchasable_variant DESC, d0_.rank DESC' 'TRACE' => '{ "steps": [ { "join_preparation": { "select_id": 1, "steps": [ { "derived": { "table": "subq", "select_id": 2, "algorithm": "materialized" } }, { "join_preparation": { "select_id": 2, "steps": [ { "expanded_query": "/* select#2 */ select d0_.root_id AS root_id,d0_.`id` AS id_0,max(d0_.rank) AS rank_1 from (((d_product d0_ left join d_product_stock d1_ on(d0_.stock_id = d1_.`id`)) left join d_product_categories_all d3_ on(d0_.`id` = d3_.product_id)) left join structure_node s2_ on(s2_.`id` = d3_.structure_node_id)) where d0_.root_id not in ( '?*??ݳ??M?z??', '?*?V1?????z??', '??F??Ld?V?z??') and d0_.`visible` = 1 and s2_.`id` = 340 and d1_.internal_amount <= 0 group by d0_.root_id" } ] } }, { "expanded_query": "/* select#1 */ select d0_.`id` AS id_0,d0_.rank AS rank_1 from ((((d_product d0_ left join d_product_stock d1_ on(d0_.stock_id = d1_.`id`)) left join d_product_categories_all d3_ on(d0_.`id` = d3_.product_id)) left join structure_node s2_ on(s2_.`id` = d3_.structure_node_id)) join (/* select#2 */ select d0_.root_id AS root_id,d0_.`id` AS id_0,max(d0_.rank) AS rank_1 from (((d_product d0_ left join d_product_stock d1_ on(d0_.stock_id = d1_.`id`)) left join d_product_categories_all d3_ on(d0_.`id` = d3_.product_id)) left join structure_node s2_ on(s2_.`id` = d3_.structure_node_id)) where d0_.root_id not in ( '?*??ݳ??M?z??', '?*?V1?????z??', '??F??Ld?V?z??') and d0_.`visible` = 1 and s2_.`id` = 340 and d1_.internal_amount <= 0 group by d0_.root_id) subq on(subq.root_id = d0_.root_id)) where subq.rank_1 = d0_.rank and d0_.root_id not in ( '?*??ݳ??M?z??', '?*?V1?????z??', '??F??Ld?V?z??') and d0_.`visible` = 1 and s2_.`id` = 340 and d1_.internal_amount <= 0 group by d0_.root_id order by d0_.purchasable_variant desc,d0_.rank desc" } ] } }, { "join_optimization": { "select_id": 1, "steps": [ { "condition_processing": { "condition": "WHERE", "original_condition": "subq.rank_1 = d0_.rank and d0_.root_id not in ( '?*??ݳ??M?z??', '?*?V1?????z??', '??F??Ld?V?z??') and d0_.`visible` = 1 and s2_.`id` = 340 and d1_.internal_amount <= 0 and subq.root_id = d0_.root_id and s2_.`id` = d3_.structure_node_id and d0_.`id` = d3_.product_id and d0_.stock_id = d1_.`id`", "steps": [ { "transformation": "equality_propagation", "resulting_condition": "d0_.root_id not in ( '?*??ݳ??M?z??', '?*?V1?????z??', '??F??Ld?V?z??') and d1_.internal_amount <= 0 and multiple equal(subq.rank_1, d0_.rank) and multiple equal(1, d0_.`visible`) and multiple equal(340, s2_.`id`, d3_.structure_node_id) and multiple equal(subq.root_id, d0_.root_id) and multiple equal(d0_.`id`, d3_.product_id) and multiple equal(d0_.stock_id, d1_.`id`)" }, { "transformation": "constant_propagation", "resulting_condition": "d0_.root_id not in ( '?*??ݳ??M?z??', '?*?V1?????z??', '??F??Ld?V?z??') and d1_.internal_amount <= 0 and multiple equal(subq.rank_1, d0_.rank) and multiple equal(1, d0_.`visible`) and multiple equal(340, s2_.`id`, d3_.structure_node_id) and multiple equal(subq.root_id, d0_.root_id) and multiple equal(d0_.`id`, d3_.product_id) and multiple equal(d0_.stock_id, d1_.`id`)" }, { "transformation": "trivial_condition_removal", "resulting_condition": "d0_.root_id not in ( '?*??ݳ??M?z??', '?*?V1?????z??', '??F??Ld?V?z??') and d1_.internal_amount <= 0 and multiple equal(subq.rank_1, d0_.rank) and multiple equal(1, d0_.`visible`) and multiple equal(340, s2_.`id`, d3_.structure_node_id) and multiple equal(subq.root_id, d0_.root_id) and multiple equal(d0_.`id`, d3_.product_id) and multiple equal(d0_.stock_id, d1_.`id`)" } ] } }, { "join_optimization": { "select_id": 2, "steps": [ { "condition_processing": { "condition": "WHERE", "original_condition": "d0_.root_id not in ( '?*??ݳ??M?z??', '?*?V1?????z??', '??F??Ld?V?z??') and d0_.`visible` = 1 and s2_.`id` = 340 and d1_.internal_amount <= 0 and s2_.`id` = d3_.structure_node_id and d0_.`id` = d3_.product_id and d0_.stock_id = d1_.`id` and d0_.root_id not in ( '?*??ݳ??M?z??', '?*?V1?????z??', '??F??Ld?V?z??')", "steps": [ { "transformation": "equality_propagation", "resulting_condition": "d0_.root_id not in ( '?*??ݳ??M?z??', '?*?V1? … } ] }' 'MISSING_BYTES_BEYOND_MAX_MEM_SIZE' => '0' 'INSUFFICIENT_PRIVILEGES' => '0'