Query time 0.15258
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "1393.80"
},
"grouping_operation": {
"using_temporary_table": true,
"using_filesort": true,
"cost_info": {
"sort_cost": "33.40"
},
"nested_loop": [
{
"table": {
"table_name": "inventory",
"access_type": "system",
"possible_keys": [
"pc"
],
"rows_examined_per_scan": 0,
"rows_produced_per_join": 1,
"filtered": "0.00",
"const_row_not_found": true,
"cost_info": {
"read_cost": "0.00",
"eval_cost": "0.20",
"prefix_cost": "0.00",
"data_read_per_join": "976"
},
"used_columns": [
"product_id",
"amount"
]
}
},
{
"table": {
"table_name": "companies",
"access_type": "const",
"possible_keys": [
"PRIMARY"
],
"key": "PRIMARY",
"used_key_parts": [
"company_id"
],
"key_length": "4",
"ref": [
"const"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 1,
"filtered": "100.00",
"cost_info": {
"read_cost": "0.00",
"eval_cost": "0.20",
"prefix_cost": "0.00",
"data_read_per_join": "5K"
},
"used_columns": [
"company_id",
"status"
]
}
},
{
"table": {
"table_name": "q_product_filters",
"access_type": "ALL",
"possible_keys": [
"PRIMARY",
"feature_id"
],
"rows_examined_per_scan": 4,
"rows_produced_per_join": 3,
"filtered": "75.00",
"cost_info": {
"read_cost": "2.27",
"eval_cost": "0.60",
"prefix_cost": "2.87",
"data_read_per_join": "192"
},
"used_columns": [
"filter_id",
"feature_id"
],
"attached_condition": "(((`portal`.`q_product_filters`.`filter_id` in (1,6,3,11)) and (`portal`.`q_product_filters`.`feature_id` in (2,10,7))) and (`portal`.`q_product_filters`.`feature_id` is not null))"
}
},
{
"table": {
"table_name": "q_product_features",
"access_type": "eq_ref",
"possible_keys": [
"PRIMARY"
],
"key": "PRIMARY",
"used_key_parts": [
"feature_id"
],
"key_length": "3",
"ref": [
"portal.q_product_filters.feature_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 0,
"filtered": "30.00",
"cost_info": {
"read_cost": "0.00",
"eval_cost": "0.18",
"prefix_cost": "3.47",
"data_read_per_join": "388"
},
"used_columns": [
"feature_id",
"feature_type"
],
"attached_condition": "(`portal`.`q_product_features`.`feature_type` in ('S','M','E'))"
}
},
{
"table": {
"table_name": "q_product_features_values",
"access_type": "ref",
"possible_keys": [
"PRIMARY",
"fl",
"variant_id",
"lang_code",
"product_id",
"fpl"
],
"key": "PRIMARY",
"used_key_parts": [
"feature_id"
],
"key_length": "3",
"ref": [
"portal.q_product_filters.feature_id"
],
"rows_examined_per_scan": 3535,
"rows_produced_per_join": 1793,
"filtered": "56.37",
"using_index": true,
"cost_info": {
"read_cost": "128.12",
"eval_cost": "358.71",
"prefix_cost": "767.90",
"data_read_per_join": "1M"
},
"used_columns": [
"feature_id",
"product_id",
"variant_id",
"lang_code"
],
"attached_condition": "((`portal`.`q_product_features_values`.`lang_code` = 'en') and (`portal`.`q_product_features_values`.`product_id` is not null))"
}
},
{
"table": {
"table_name": "products",
"access_type": "eq_ref",
"possible_keys": [
"PRIMARY",
"status"
],
"key": "PRIMARY",
"used_key_parts": [
"product_id"
],
"key_length": "3",
"ref": [
"portal.q_product_features_values.product_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 166,
"filtered": "9.31",
"cost_info": {
"read_cost": "0.00",
"eval_cost": "33.40",
"prefix_cost": "1126.61",
"data_read_per_join": "985K"
},
"used_columns": [
"product_id",
"status",
"company_id",
"amount",
"usergroup_ids",
"tracking"
],
"attached_condition": "((`portal`.`products`.`company_id` = 12) and (case `portal`.`products`.`tracking` when 'O' then <cache>((NULL > 0)) when 'B' then (`portal`.`products`.`amount` > 0) else 1 end) and ((`portal`.`products`.`usergroup_ids` = '') or find_in_set(0,`portal`.`products`.`usergroup_ids`) or find_in_set(1,`portal`.`products`.`usergroup_ids`)) and (`portal`.`products`.`status` = 'A'))"
}
},
{
"table": {
"table_name": "products_categories",
"access_type": "ref",
"possible_keys": [
"PRIMARY",
"pt"
],
"key": "pt",
"used_key_parts": [
"product_id"
],
"key_length": "3",
"ref": [
"portal.q_product_features_values.product_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 166,
"filtered": "100.00",
"cost_info": {
"read_cost": "167.00",
"eval_cost": "33.40",
"prefix_cost": "1327.00",
"data_read_per_join": "2K"
},
"used_columns": [
"product_id",
"category_id"
]
}
},
{
"table": {
"table_name": "q_categories",
"access_type": "eq_ref",
"possible_keys": [
"PRIMARY",
"c_status",
"p_category_id"
],
"key": "PRIMARY",
"used_key_parts": [
"category_id"
],
"key_length": "3",
"ref": [
"portal.products_categories.category_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 33,
"filtered": "20.00",
"cost_info": {
"read_cost": "0.00",
"eval_cost": "6.68",
"prefix_cost": "1360.40",
"data_read_per_join": "88K"
},
"used_columns": [
"category_id",
"usergroup_ids",
"status"
],
"attached_condition": "(((`portal`.`q_categories`.`usergroup_ids` = '') or find_in_set(0,`portal`.`q_categories`.`usergroup_ids`) or find_in_set(1,`portal`.`q_categories`.`usergroup_ids`)) and (`portal`.`q_categories`.`status` in ('A','H')))"
}
}
]
}
}
}
Result
filter_id |
variant_id |
6 |
35 |
6 |
36 |
6 |
37 |
6 |
39 |
6 |
41 |
6 |
42 |
6 |
43 |
6 |
48 |
1 |
132 |
1 |
133 |
1 |
134 |
1 |
135 |
1 |
136 |
1 |
137 |
1 |
138 |
6 |
139 |
6 |
140 |
6 |
143 |
6 |
148 |
1 |
154 |
6 |
157 |
1 |
160 |
1 |
161 |
1 |
183 |
1 |
193 |
1 |
194 |
1 |
198 |
1 |
210 |
6 |
256 |
1 |
272 |
1 |
273 |
1 |
274 |
1 |
275 |
1 |
276 |
1 |
277 |
1 |
278 |
1 |
279 |
1 |
288 |
1 |
289 |
1 |
5776 |
1 |
5777 |
1 |
5778 |
1 |
5862 |
1 |
5932 |
1 |
5994 |
6 |
6047 |
1 |
6141 |
1 |
6173 |
6 |
6205 |
6 |
6213 |
1 |
6311 |
6 |
6448 |
1 |
6632 |
1 |
6760 |
6 |
7594 |
1 |
7604 |
1 |
7605 |
1 |
7607 |
1 |
7613 |
6 |
7987 |
6 |
8152 |
6 |
8478 |
6 |
8486 |
6 |
8496 |
6 |
8532 |
6 |
8533 |
6 |
8534 |
6 |
8535 |
6 |
8536 |
6 |
8537 |
6 |
8538 |
6 |
8539 |
6 |
8540 |
1 |
8555 |
6 |
8646 |
6 |
8748 |
1 |
8949 |
6 |
9222 |
1 |
9365 |
1 |
9442 |
6 |
9632 |
6 |
9697 |
1 |
9712 |
6 |
9713 |
6 |
9714 |
1 |
9716 |