Query time 0.00777
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "122.54"
},
"ordering_operation": {
"using_filesort": true,
"grouping_operation": {
"using_temporary_table": true,
"using_filesort": false,
"nested_loop": [
{
"table": {
"table_name": "shared_prices",
"access_type": "system",
"possible_keys": [
"usergroup",
"product_id",
"company_id",
"lower_limit",
"usergroup_id"
],
"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.10",
"prefix_cost": "0.00",
"data_read_per_join": "32"
},
"used_columns": [
"product_id",
"price",
"percentage_discount",
"lower_limit",
"company_id",
"usergroup_id"
]
}
},
{
"table": {
"table_name": "cscart_categories",
"access_type": "const",
"possible_keys": [
"PRIMARY",
"c_status",
"p_category_id"
],
"key": "PRIMARY",
"used_key_parts": [
"category_id"
],
"key_length": "3",
"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": "4K"
},
"used_columns": [
"category_id",
"usergroup_ids",
"status",
"storefront_id"
]
}
},
{
"table": {
"table_name": "companies",
"access_type": "ALL",
"possible_keys": [
"PRIMARY"
],
"rows_examined_per_scan": 2,
"rows_produced_per_join": 1,
"filtered": "50.00",
"cost_info": {
"read_cost": "0.62",
"eval_cost": "0.10",
"prefix_cost": "0.72",
"data_read_per_join": "5K"
},
"used_columns": [
"company_id",
"status",
"company"
],
"attached_condition": "(`primapearl_r_new`.`companies`.`status` = 'A')"
}
},
{
"table": {
"table_name": "products_categories",
"access_type": "ref",
"possible_keys": [
"PRIMARY",
"pt"
],
"key": "PRIMARY",
"used_key_parts": [
"category_id"
],
"key_length": "3",
"ref": [
"const"
],
"rows_examined_per_scan": 501,
"rows_produced_per_join": 501,
"filtered": "100.00",
"using_index": true,
"cost_info": {
"read_cost": "3.38",
"eval_cost": "50.10",
"prefix_cost": "54.19",
"data_read_per_join": "7K"
},
"used_columns": [
"product_id",
"category_id"
]
}
},
{
"table": {
"table_name": "products",
"access_type": "eq_ref",
"possible_keys": [
"PRIMARY",
"status",
"idx_parent_product_id"
],
"key": "PRIMARY",
"used_key_parts": [
"product_id"
],
"key_length": "3",
"ref": [
"primapearl_r_new.products_categories.product_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 33,
"filtered": "6.62",
"cost_info": {
"read_cost": "0.00",
"eval_cost": "3.32",
"prefix_cost": "104.29",
"data_read_per_join": "278K"
},
"used_columns": [
"product_id",
"product_type",
"status",
"company_id",
"usergroup_ids",
"parent_product_id"
],
"attached_condition": "((`primapearl_r_new`.`products`.`company_id` = `primapearl_r_new`.`companies`.`company_id`) and (`primapearl_r_new`.`products`.`parent_product_id` = 0) and ((`primapearl_r_new`.`products`.`usergroup_ids` = '') or (0 <> find_in_set(0,`primapearl_r_new`.`products`.`usergroup_ids`)) or (0 <> find_in_set(1,`primapearl_r_new`.`products`.`usergroup_ids`))) and (`primapearl_r_new`.`products`.`status` = 'A'))"
}
},
{
"table": {
"table_name": "shared_descr",
"access_type": "eq_ref",
"possible_keys": [
"PRIMARY",
"product_id",
"company_id"
],
"key": "PRIMARY",
"used_key_parts": [
"product_id",
"lang_code",
"company_id"
],
"key_length": "13",
"ref": [
"primapearl_r_new.products_categories.product_id",
"const",
"const"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 33,
"filtered": "100.00",
"cost_info": {
"read_cost": "0.00",
"eval_cost": "3.32",
"prefix_cost": "107.61",
"data_read_per_join": "126K"
},
"used_columns": [
"product_id",
"lang_code",
"company_id",
"product"
]
}
},
{
"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": [
"primapearl_r_new.products_categories.product_id",
"const"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 33,
"filtered": "100.00",
"cost_info": {
"read_cost": "0.00",
"eval_cost": "3.32",
"prefix_cost": "110.93",
"data_read_per_join": "126K"
},
"used_columns": [
"product_id",
"lang_code",
"product"
]
}
},
{
"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": [
"primapearl_r_new.products_categories.product_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 14,
"filtered": "44.01",
"cost_info": {
"read_cost": "8.29",
"eval_cost": "1.46",
"prefix_cost": "122.54",
"data_read_per_join": "350"
},
"used_columns": [
"product_id",
"price",
"percentage_discount",
"lower_limit",
"usergroup_id"
],
"attached_condition": "((`primapearl_r_new`.`prices`.`lower_limit` = 1) and (`primapearl_r_new`.`prices`.`usergroup_id` in (0,0,1)))"
}
}
]
}
}
}
}
Result
| product_id |
product |
company_name |
price |
product_type |
parent_product_id |
| 5616 |
Gold pendants |
Prima English |
0.00000000 |
P |
0 |
| 5617 |
Gold pendants |
Prima English |
0.00000000 |
P |
0 |
| 5618 |
Gold pendants |
Prima English |
0.00000000 |
P |
0 |
| 5619 |
Gold pendants |
Prima English |
0.00000000 |
P |
0 |
| 5620 |
Gold pendants |
Prima English |
0.00000000 |
P |
0 |
| 5621 |
Gold pendants |
Prima English |
0.00000000 |
P |
0 |
| 5622 |
Gold pendants |
Prima English |
0.00000000 |
P |
0 |
| 5623 |
Gold pendants |
Prima English |
0.00000000 |
P |
0 |
| 5625 |
Gold pendants |
Prima English |
0.00000000 |
P |
0 |
| 5627 |
Gold pendants |
Prima English |
0.00000000 |
P |
0 |
| 5628 |
Gold pendants |
Prima English |
0.00000000 |
P |
0 |
| 5633 |
Gold pendants |
Prima English |
0.00000000 |
P |
0 |
| 5635 |
Gold pendants |
Prima English |
0.00000000 |
P |
0 |
| 5636 |
Gold pendants |
Prima English |
0.00000000 |
P |
0 |
| 5637 |
Gold pendants |
Prima English |
0.00000000 |
P |
0 |
| 5639 |
Gold pendants |
Prima English |
0.00000000 |
P |
0 |
| 5640 |
Gold pendants |
Prima English |
0.00000000 |
P |
0 |
| 5641 |
Gold pendants |
Prima English |
0.00000000 |
P |
0 |
| 5642 |
Gold pendants |
Prima English |
0.00000000 |
P |
0 |
| 5643 |
Gold pendants |
Prima English |
0.00000000 |
P |
0 |
| 5644 |
Gold pendants |
Prima English |
0.00000000 |
P |
0 |
| 5649 |
Gold pendants |
Prima English |
0.00000000 |
P |
0 |
| 5652 |
Gold pendants |
Prima English |
0.00000000 |
P |
0 |
| 5653 |
Gold pendants |
Prima English |
0.00000000 |
P |
0 |
| 5654 |
Gold pendants |
Prima English |
0.00000000 |
P |
0 |
| 5656 |
Gold pendants |
Prima English |
0.00000000 |
P |
0 |
| 5657 |
Gold pendants |
Prima English |
0.00000000 |
P |
0 |