Query time 0.00113
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "9.23"
},
"ordering_operation": {
"using_filesort": true,
"grouping_operation": {
"using_temporary_table": true,
"using_filesort": false,
"nested_loop": [
{
"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.10",
"prefix_cost": "0.00",
"data_read_per_join": "11K"
},
"used_columns": [
"company_id",
"status",
"company"
]
}
},
{
"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": "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": 13,
"filtered": "100.00",
"using_index": true,
"cost_info": {
"read_cost": "0.25",
"eval_cost": "1.39",
"prefix_cost": "3.39",
"data_read_per_join": "222"
},
"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.07",
"prefix_cost": "8.26",
"data_read_per_join": "3K"
},
"used_columns": [
"product_id",
"product_type",
"status",
"company_id",
"amount",
"timestamp",
"usergroup_ids",
"tracking",
"parent_product_id",
"is_stock_split_by_warehouses"
],
"attached_condition": "((`shoptheindependents_com`.`products`.`parent_product_id` = 0) and (`shoptheindependents_com`.`products`.`company_id` = 102) 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": "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.17",
"eval_cost": "0.07",
"prefix_cost": "8.50",
"data_read_per_join": "11"
},
"used_columns": [
"storefront_id",
"product_id"
]
}
},
{
"table": {
"table_name": "prices",
"access_type": "ref",
"possible_keys": [
"usergroup",
"product_id",
"lower_limit",
"usergroup_id"
],
"key": "product_id",
"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.17",
"eval_cost": "0.07",
"prefix_cost": "8.75",
"data_read_per_join": "16"
},
"used_columns": [
"product_id",
"lower_limit",
"usergroup_id"
],
"attached_condition": "((`shoptheindependents_com`.`prices`.`lower_limit` = 1) and (`shoptheindependents_com`.`prices`.`usergroup_id` in (0,0,1)))"
}
},
{
"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.17",
"eval_cost": "0.07",
"prefix_cost": "8.99",
"data_read_per_join": "11"
},
"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.17",
"eval_cost": "0.07",
"prefix_cost": "9.24",
"data_read_per_join": "2K"
},
"used_columns": [
"product_id",
"lang_code",
"product"
]
}
}
]
}
}
}
}
Result
| product_id |
product |
company_name |
product_type |
parent_product_id |
| 3077 |
Louise Slide Sandal |
Sophia's Shop |
P |
0 |
| 3075 |
Louise Slide Sandal |
Sophia's Shop |
P |
0 |
| 3064 |
Dôme Figure Ring |
Sophia's Shop |
P |
0 |
| 3061 |
Dôme Figure Ring |
Sophia's Shop |
P |
0 |
| 3022 |
Asher Jacket |
Sophia's Shop |
P |
0 |
| 2970 |
Mini Woven Bag |
Sophia's Shop |
P |
0 |
| 2929 |
Cape Side Table |
Sophia's Shop |
P |
0 |
| 2881 |
Classic Turkish Cotton Robe |
Sophia's Shop |
P |
0 |
| 2786 |
Shearling Wool Slides |
Sophia's Shop |
P |
0 |