Query time 0.12068
JSON explain
{
"query_block": {
"select_id": 1,
"having_condition": "sales_discount > 0 and price < products.list_price",
"filesort": {
"sort_key": "if(NULL is not null,NULL,descr1.product), products.product_id",
"temporary_table": {
"table": {
"table_name": "shared_descr",
"access_type": "system",
"possible_keys": ["PRIMARY", "product_id", "company_id"],
"rows": 0,
"filtered": 0,
"const_row_not_found": true
},
"table": {
"table_name": "prices",
"access_type": "ALL",
"possible_keys": [
"usergroup",
"product_id",
"lower_limit",
"usergroup_id"
],
"rows": 1699,
"filtered": 99.23484039,
"attached_condition": "prices.lower_limit = 1 and prices.usergroup_id in (0,0,1)"
},
"table": {
"table_name": "products",
"access_type": "eq_ref",
"possible_keys": ["PRIMARY", "status", "idx_parent_product_id"],
"key": "PRIMARY",
"key_length": "3",
"used_key_parts": ["product_id"],
"ref": ["noframes_angrybeaver.prices.product_id"],
"rows": 1,
"filtered": 96.7084198,
"attached_condition": "products.parent_product_id = 0 and (products.amount > 0 or products.tracking = 'D') and (products.usergroup_ids = '' or find_in_set(0,products.usergroup_ids) or find_in_set(1,products.usergroup_ids)) and products.`status` = 'A'"
},
"table": {
"table_name": "shared_prices",
"access_type": "ref",
"possible_keys": [
"usergroup",
"product_id",
"company_id",
"lower_limit",
"usergroup_id"
],
"key": "lower_limit",
"key_length": "3",
"used_key_parts": ["lower_limit"],
"ref": ["const"],
"rows": 1,
"filtered": 100,
"attached_condition": "trigcond(shared_prices.product_id = prices.product_id and shared_prices.company_id = 1 and shared_prices.usergroup_id in (0,0,1))"
},
"table": {
"table_name": "shared_prices_2",
"access_type": "ref",
"possible_keys": [
"usergroup",
"product_id",
"company_id",
"lower_limit",
"usergroup_id"
],
"key": "lower_limit",
"key_length": "3",
"used_key_parts": ["lower_limit"],
"ref": ["const"],
"rows": 1,
"filtered": 100,
"attached_condition": "trigcond(shared_prices_2.price is null) and trigcond(shared_prices_2.product_id = shared_prices.product_id and shared_prices_2.company_id = 1 and shared_prices_2.price < shared_prices.price and shared_prices_2.usergroup_id in (0,0,1))",
"not_exists": true
},
"table": {
"table_name": "prices_2",
"access_type": "ref",
"possible_keys": [
"usergroup",
"product_id",
"lower_limit",
"usergroup_id"
],
"key": "product_id",
"key_length": "3",
"used_key_parts": ["product_id"],
"ref": ["noframes_angrybeaver.prices.product_id"],
"rows": 1,
"filtered": 99.23484039,
"attached_condition": "trigcond(prices_2.price is null) and trigcond(prices_2.lower_limit = 1 and prices_2.price < prices.price and prices_2.usergroup_id in (0,0,1))",
"not_exists": true
},
"table": {
"table_name": "popularity",
"access_type": "ref",
"possible_keys": ["PRIMARY", "total"],
"key": "total",
"key_length": "3",
"used_key_parts": ["product_id"],
"ref": ["noframes_angrybeaver.prices.product_id"],
"rows": 1,
"filtered": 100,
"using_index": true
},
"table": {
"table_name": "products_categories",
"access_type": "ref",
"possible_keys": ["PRIMARY", "pt"],
"key": "pt",
"key_length": "3",
"used_key_parts": ["product_id"],
"ref": ["noframes_angrybeaver.prices.product_id"],
"rows": 1,
"filtered": 100
},
"table": {
"table_name": "cscart_categories",
"access_type": "eq_ref",
"possible_keys": ["PRIMARY", "c_status", "p_category_id"],
"key": "PRIMARY",
"key_length": "3",
"used_key_parts": ["category_id"],
"ref": ["noframes_angrybeaver.products_categories.category_id"],
"rows": 1,
"filtered": 100,
"attached_condition": "(cscart_categories.usergroup_ids = '' or find_in_set(0,cscart_categories.usergroup_ids) or find_in_set(1,cscart_categories.usergroup_ids)) and cscart_categories.`status` in ('A','H') and cscart_categories.storefront_id in (0,1)"
},
"table": {
"table_name": "bs_shared_prices",
"access_type": "ref",
"possible_keys": [
"usergroup",
"product_id",
"company_id",
"lower_limit",
"usergroup_id"
],
"key": "lower_limit",
"key_length": "3",
"used_key_parts": ["lower_limit"],
"ref": ["const"],
"rows": 1,
"filtered": 100,
"attached_condition": "trigcond(bs_shared_prices.product_id = prices.product_id and bs_shared_prices.company_id = 1 and bs_shared_prices.usergroup_id in (0,0,1))"
},
"block-nl-join": {
"table": {
"table_name": "companies",
"access_type": "ALL",
"possible_keys": ["PRIMARY"],
"rows": 2,
"filtered": 100,
"attached_condition": "companies.`status` = 'A'"
},
"buffer_type": "flat",
"buffer_size": "2048Kb",
"join_type": "BNL",
"attached_condition": "companies.company_id = products.company_id"
},
"table": {
"table_name": "cscart_product_features_values",
"access_type": "ref",
"possible_keys": [
"lang_code",
"product_id",
"idx_product_feature_variant_id"
],
"key": "idx_product_feature_variant_id",
"key_length": "3",
"used_key_parts": ["product_id"],
"ref": ["noframes_angrybeaver.prices.product_id"],
"rows": 5,
"filtered": 56.88951111,
"attached_condition": "trigcond(cscart_product_features_values.lang_code = 'ru')",
"using_index": true
},
"table": {
"table_name": "descr1",
"access_type": "eq_ref",
"possible_keys": ["PRIMARY", "product_id"],
"key": "PRIMARY",
"key_length": "9",
"used_key_parts": ["product_id", "lang_code"],
"ref": ["noframes_angrybeaver.prices.product_id", "const"],
"rows": 1,
"filtered": 100,
"attached_condition": "trigcond(descr1.lang_code = 'ru')"
}
}
}
}
}
Result
| product_id |
product |
company_name |
popularity |
price |
product_type |
parent_product_id |
list_price |
sales_discount |
is_shared_product |
| 10370 |
Impulse col.01 |
NoFrames |
4402 |
2763.44000000 |
P |
0 |
3182.00 |
13.153991201000 |
N |
| 10372 |
Impulse col.02 |
NoFrames |
4580 |
2763.44000000 |
P |
0 |
3182.00 |
13.153991201000 |
N |
| 10374 |
Impulse col.03 |
NoFrames |
4771 |
2763.44000000 |
P |
0 |
3182.00 |
13.153991201000 |
N |
| 10376 |
Impulse col.04 |
NoFrames |
4704 |
2763.44000000 |
P |
0 |
3182.00 |
13.153991201000 |
N |
| 10377 |
Impulse col.05 |
NoFrames |
4334 |
2763.44000000 |
P |
0 |
3182.00 |
13.153991201000 |
N |
| 10378 |
Impulse col.06 |
NoFrames |
3433 |
2763.44000000 |
P |
0 |
3182.00 |
13.153991201000 |
N |
| 10379 |
Impulse col.07 |
NoFrames |
4306 |
2763.44000000 |
P |
0 |
3182.00 |
13.153991201000 |
N |
| 10380 |
Impulse col.08 |
NoFrames |
3538 |
2763.44000000 |
P |
0 |
3182.00 |
13.153991201000 |
N |
| 10381 |
Impulse col.09 |
NoFrames |
3403 |
2763.44000000 |
P |
0 |
3182.00 |
13.153991201000 |
N |
| 10371 |
Impulse I col.01 |
NoFrames |
8312 |
2763.44000000 |
P |
0 |
3182.00 |
13.153991201000 |
N |
| 10373 |
Impulse I col.02 |
NoFrames |
5716 |
2763.44000000 |
P |
0 |
3182.00 |
13.153991201000 |
N |
| 10375 |
Impulse I col.03 |
NoFrames |
4906 |
2763.44000000 |
P |
0 |
3182.00 |
13.153991201000 |
N |
| 12944 |
Philosophy Jute сol.01 |
NoFrames |
2232 |
1560.00000000 |
P |
0 |
2105.00 |
25.890736343000 |
N |
| 15781 |
Respect col.05 |
NoFrames |
2420 |
1317.94000000 |
P |
0 |
3010.00 |
56.214617941000 |
N |
| 12853 |
Respect col.13 |
NoFrames |
1885 |
1317.94000000 |
P |
0 |
3010.00 |
56.214617941000 |
N |
| 12854 |
Respect col.15 |
NoFrames |
1692 |
1317.94000000 |
P |
0 |
3010.00 |
56.214617941000 |
N |
| 12855 |
Respect col.16 |
NoFrames |
2324 |
1317.94000000 |
P |
0 |
3010.00 |
56.214617941000 |
N |
| 12856 |
Respect col.20 |
NoFrames |
2501 |
1317.94000000 |
P |
0 |
3010.00 |
56.214617941000 |
N |
| 12551 |
Турецкий ковер BAMBOO CUPRUM 200x300 |
NoFrames |
17261 |
15215.00000000 |
P |
0 |
43472.00 |
65.000460067000 |
N |