Query time 0.00133
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "5.81"
},
"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": 20,
"rows_produced_per_join": 20,
"filtered": "100.00",
"using_index": true,
"cost_info": {
"read_cost": "0.37",
"eval_cost": "2.00",
"prefix_cost": "3.09",
"data_read_per_join": "320"
},
"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": 1,
"filtered": "6.62",
"cost_info": {
"read_cost": "0.00",
"eval_cost": "0.13",
"prefix_cost": "5.09",
"data_read_per_join": "11K"
},
"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": 1,
"filtered": "100.00",
"cost_info": {
"read_cost": "0.00",
"eval_cost": "0.13",
"prefix_cost": "5.22",
"data_read_per_join": "5K"
},
"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": 1,
"filtered": "100.00",
"cost_info": {
"read_cost": "0.00",
"eval_cost": "0.13",
"prefix_cost": "5.35",
"data_read_per_join": "5K"
},
"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": 0,
"filtered": "44.01",
"cost_info": {
"read_cost": "0.33",
"eval_cost": "0.06",
"prefix_cost": "5.82",
"data_read_per_join": "13"
},
"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 |
| 8724 |
Колье |
PRIMA |
11570.00000000 |
P |
0 |
| 8723 |
Колье |
PRIMA |
31900.00000000 |
P |
0 |
| 8518 |
Колье из красного золота 585° пробы с жемчугом |
PRIMA |
32950.00000000 |
P |
0 |
| 8706 |
Колье из белого золота 585° пробы с жемчугом и фианитом |
PRIMA |
35640.00000000 |
P |
0 |
| 8707 |
Колье из белого золота 585° пробы с жемчугом и фианитом |
PRIMA |
37740.00000000 |
P |
0 |
| 8513 |
Колье из красного золота 585° пробы с жемчугом |
PRIMA |
38560.00000000 |
P |
0 |
| 8514 |
Колье из красного золота 585° пробы с жемчугом |
PRIMA |
52810.00000000 |
P |
0 |
| 8520 |
Колье из красного золота 585° пробы с жемчугом |
PRIMA |
54210.00000000 |
P |
0 |
| 8521 |
Колье из красного золота 585° пробы с жемчугом |
PRIMA |
55260.00000000 |
P |
0 |
| 8516 |
Колье из красного золота 585° пробы с жемчугом |
PRIMA |
63560.00000000 |
P |
0 |
| 8515 |
Колье из красного золота 585° пробы с жемчугом |
PRIMA |
71150.00000000 |
P |
0 |
| 8517 |
Колье из красного золота 585° пробы с жемчугом |
PRIMA |
86570.00000000 |
P |
0 |