Query time 0.06956
JSON explain
{
"query_block": {
"select_id": 1,
"filesort": {
"sort_key": "popularity.total desc, products.product_id",
"temporary_table": {
"table": {
"table_name": "products",
"access_type": "ALL",
"possible_keys": ["PRIMARY", "status"],
"rows": 6292,
"filtered": 87.96884918,
"attached_condition": "products.product_id <> 981 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_descr",
"access_type": "eq_ref",
"possible_keys": ["PRIMARY", "product_id", "company_id"],
"key": "PRIMARY",
"key_length": "13",
"used_key_parts": ["product_id", "lang_code", "company_id"],
"ref": ["rfswire_cart.products.product_id", "const", "const"],
"rows": 1,
"filtered": 100,
"attached_condition": "trigcond(shared_descr.lang_code = 'en')"
},
"table": {
"table_name": "shared_prices",
"access_type": "ref",
"possible_keys": [
"usergroup",
"product_id",
"company_id",
"lower_limit",
"usergroup_id"
],
"key": "usergroup",
"key_length": "3",
"used_key_parts": ["product_id"],
"ref": ["rfswire_cart.products.product_id"],
"rows": 1,
"filtered": 52.27272797,
"attached_condition": "trigcond(shared_prices.lower_limit = 1 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": "usergroup",
"key_length": "3",
"used_key_parts": ["product_id"],
"ref": ["rfswire_cart.shared_prices.product_id"],
"rows": 1,
"filtered": 52.27272797,
"attached_condition": "trigcond(shared_prices_2.price is null) and trigcond(shared_prices_2.company_id = 1 and shared_prices_2.lower_limit = 1 and shared_prices_2.price < shared_prices.price and shared_prices_2.usergroup_id in (0,0,1) and trigcond(shared_prices.product_id is not null))",
"not_exists": true
},
"table": {
"table_name": "descr1",
"access_type": "ref",
"possible_keys": ["PRIMARY", "product_id"],
"key": "product_id",
"key_length": "3",
"used_key_parts": ["product_id"],
"ref": ["rfswire_cart.products.product_id"],
"rows": 1,
"filtered": 100,
"attached_condition": "trigcond(descr1.lang_code = 'en')"
},
"table": {
"table_name": "popularity",
"access_type": "ref",
"possible_keys": ["PRIMARY", "total"],
"key": "total",
"key_length": "3",
"used_key_parts": ["product_id"],
"ref": ["rfswire_cart.products.product_id"],
"rows": 1,
"filtered": 100,
"using_index": true
},
"table": {
"table_name": "prices",
"access_type": "ref",
"possible_keys": [
"usergroup",
"product_id",
"lower_limit",
"usergroup_id"
],
"key": "product_id",
"key_length": "3",
"used_key_parts": ["product_id"],
"ref": ["rfswire_cart.products.product_id"],
"rows": 1,
"filtered": 64.25627899,
"attached_condition": "prices.lower_limit = 1 and (prices.price >= 510.68 or shared_prices.price >= 510.68) and (prices.price <= 564.44 or shared_prices.price <= 564.44) and prices.usergroup_id in (0,0,1)"
},
"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": ["rfswire_cart.products.product_id"],
"rows": 1,
"filtered": 64.24570465,
"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": "products_categories",
"access_type": "ref",
"possible_keys": ["PRIMARY", "pt"],
"key": "pt",
"key_length": "3",
"used_key_parts": ["product_id"],
"ref": ["rfswire_cart.products.product_id"],
"rows": 2,
"filtered": 100
},
"table": {
"table_name": "cscart_categories",
"access_type": "ref",
"possible_keys": ["PRIMARY", "c_status", "p_category_id"],
"key": "p_category_id",
"key_length": "3",
"used_key_parts": ["category_id"],
"ref": ["rfswire_cart.products_categories.category_id"],
"rows": 1,
"filtered": 100,
"index_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')",
"attached_condition": "cscart_categories.company_id = 1"
}
}
}
}
}
Result
| product_id |
product |
price |
| 4793 |
Motorola RLN6491 - Heavy Duty Bluetooth Headset |
549.260000 |
| 951 |
SV-CLCD70RP - Single Camera Rear Vision System |
561.250000 |
| 4705 |
Motorola NNTN8434 - Accessory Kit, Completely Discreet Wireless Surveillance Kit |
515.000000 |