Query time 0.00218
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "11.61"
},
"ordering_operation": {
"using_filesort": false,
"grouping_operation": {
"using_temporary_table": true,
"using_filesort": false,
"nested_loop": [
{
"table": {
"table_name": "cscart_categories",
"access_type": "ALL",
"possible_keys": [
"PRIMARY",
"c_status",
"p_category_id"
],
"rows_examined_per_scan": 15,
"rows_produced_per_join": 0,
"filtered": "6.67",
"cost_info": {
"read_cost": "1.65",
"eval_cost": "0.10",
"prefix_cost": "1.75",
"data_read_per_join": "2K"
},
"used_columns": [
"category_id",
"usergroup_ids",
"status",
"storefront_id"
],
"attached_condition": "(((`shoptheindependents_com`.`cscart_categories`.`usergroup_ids` = '') or (0 <> find_in_set(0,`shoptheindependents_com`.`cscart_categories`.`usergroup_ids`)) or (0 <> find_in_set(1,`shoptheindependents_com`.`cscart_categories`.`usergroup_ids`))) and (`shoptheindependents_com`.`cscart_categories`.`status` in ('A','H')) and (`shoptheindependents_com`.`cscart_categories`.`storefront_id` in (0,1)))"
}
},
{
"table": {
"table_name": "companies",
"access_type": "ALL",
"possible_keys": [
"PRIMARY"
],
"rows_examined_per_scan": 13,
"rows_produced_per_join": 1,
"filtered": "10.00",
"using_join_buffer": "hash join",
"cost_info": {
"read_cost": "1.42",
"eval_cost": "0.13",
"prefix_cost": "3.30",
"data_read_per_join": "14K"
},
"used_columns": [
"company_id",
"status",
"company"
],
"attached_condition": "((`shoptheindependents_com`.`companies`.`status` = 'A') and (`shoptheindependents_com`.`companies`.`company_id` in (26,80,85,86,87,88,89,90,91,101,102,103,104,0)))"
}
},
{
"table": {
"table_name": "products_categories",
"access_type": "ref",
"possible_keys": [
"PRIMARY",
"pt"
],
"key": "PRIMARY",
"used_key_parts": [
"category_id"
],
"key_length": "3",
"ref": [
"shoptheindependents_com.cscart_categories.category_id"
],
"rows_examined_per_scan": 13,
"rows_produced_per_join": 18,
"filtered": "100.00",
"using_index": true,
"cost_info": {
"read_cost": "0.33",
"eval_cost": "1.81",
"prefix_cost": "5.44",
"data_read_per_join": "289"
},
"used_columns": [
"product_id",
"category_id"
]
}
},
{
"table": {
"table_name": "products",
"access_type": "eq_ref",
"possible_keys": [
"PRIMARY",
"age_verification",
"status",
"idx_parent_product_id",
"idx_master_product_id"
],
"key": "PRIMARY",
"used_key_parts": [
"product_id"
],
"key_length": "3",
"ref": [
"shoptheindependents_com.products_categories.product_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 0,
"filtered": "5.00",
"cost_info": {
"read_cost": "3.47",
"eval_cost": "0.09",
"prefix_cost": "10.72",
"data_read_per_join": "4K"
},
"used_columns": [
"product_id",
"product_type",
"status",
"company_id",
"amount",
"usergroup_ids",
"tracking",
"parent_product_id",
"is_stock_split_by_warehouses"
],
"attached_condition": "((`shoptheindependents_com`.`products`.`company_id` = `shoptheindependents_com`.`companies`.`company_id`) and ((`shoptheindependents_com`.`products`.`usergroup_ids` = '') or (0 <> find_in_set(0,`shoptheindependents_com`.`products`.`usergroup_ids`)) or (0 <> find_in_set(1,`shoptheindependents_com`.`products`.`usergroup_ids`))) and (`shoptheindependents_com`.`products`.`status` = 'A'))"
}
},
{
"table": {
"table_name": "variation_group_products",
"access_type": "ref",
"possible_keys": [
"PRIMARY",
"idx_group_id"
],
"key": "PRIMARY",
"used_key_parts": [
"product_id"
],
"key_length": "3",
"ref": [
"shoptheindependents_com.products_categories.product_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 0,
"filtered": "57.78",
"using_index": true,
"cost_info": {
"read_cost": "0.23",
"eval_cost": "0.06",
"prefix_cost": "11.05",
"data_read_per_join": "9"
},
"used_columns": [
"product_id",
"group_id"
],
"attached_condition": "(`shoptheindependents_com`.`variation_group_products`.`group_id` in (462,459))"
}
},
{
"table": {
"table_name": "war_sum_amount",
"access_type": "ref",
"possible_keys": [
"PRIMARY"
],
"key": "PRIMARY",
"used_key_parts": [
"product_id"
],
"key_length": "3",
"ref": [
"shoptheindependents_com.products_categories.product_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 0,
"filtered": "100.00",
"using_index": true,
"cost_info": {
"read_cost": "0.15",
"eval_cost": "0.06",
"prefix_cost": "11.26",
"data_read_per_join": "9"
},
"used_columns": [
"storefront_id",
"product_id"
]
}
},
{
"table": {
"table_name": "warehouses_destination_products_amount",
"access_type": "eq_ref",
"possible_keys": [
"PRIMARY",
"idx_storefront_id"
],
"key": "PRIMARY",
"used_key_parts": [
"product_id",
"destination_id",
"storefront_id"
],
"key_length": "9",
"ref": [
"shoptheindependents_com.products_categories.product_id",
"const",
"const"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 0,
"filtered": "100.00",
"cost_info": {
"read_cost": "0.12",
"eval_cost": "0.06",
"prefix_cost": "11.44",
"data_read_per_join": "9"
},
"used_columns": [
"destination_id",
"storefront_id",
"product_id",
"amount"
],
"attached_condition": "<if>(found_match(warehouses_destination_products_amount), (((case `shoptheindependents_com`.`products`.`is_stock_split_by_warehouses` when 'Y' then `shoptheindependents_com`.`warehouses_destination_products_amount`.`amount` else `shoptheindependents_com`.`products`.`amount` end) > 0) or (`shoptheindependents_com`.`products`.`tracking` = 'D')), true)"
}
},
{
"table": {
"table_name": "descr1",
"access_type": "eq_ref",
"possible_keys": [
"PRIMARY",
"product_id"
],
"key": "PRIMARY",
"used_key_parts": [
"product_id",
"lang_code"
],
"key_length": "9",
"ref": [
"shoptheindependents_com.products_categories.product_id",
"const"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 0,
"filtered": "100.00",
"cost_info": {
"read_cost": "0.12",
"eval_cost": "0.06",
"prefix_cost": "11.61",
"data_read_per_join": "2K"
},
"used_columns": [
"product_id",
"lang_code",
"product"
]
}
}
]
}
}
}
}
Result
| product_id |
amount |
product |
company_name |
variation_group_id |
product_type |
parent_product_id |
| 3077 |
2 |
Louise Slide Sandal |
Sophia's Shop |
462 |
P |
0 |
| 3078 |
9 |
Louise Slide Sandal |
Sophia's Shop |
462 |
V |
3077 |
| 3017 |
6 |
Asher Jacket |
Sophia's Shop |
459 |
V |
3022 |
| 3018 |
6 |
Asher Jacket |
Sophia's Shop |
459 |
V |
3022 |
| 3019 |
1 |
Asher Jacket |
Sophia's Shop |
459 |
V |
3022 |
| 3020 |
2 |
Asher Jacket |
Sophia's Shop |
459 |
V |
3022 |
| 3021 |
6 |
Asher Jacket |
Sophia's Shop |
459 |
V |
3022 |
| 3022 |
5 |
Asher Jacket |
Sophia's Shop |
459 |
P |
0 |
| 3074 |
5 |
Louise Slide Sandal |
Sophia's Shop |
462 |
V |
3073 |
| 3075 |
7 |
Louise Slide Sandal |
Sophia's Shop |
462 |
P |
0 |
| 3076 |
9 |
Louise Slide Sandal |
Sophia's Shop |
462 |
V |
3075 |