Query time 0.00276
JSON explain
{
"query_block": {
"select_id": 1,
"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": "cscart_categories",
"access_type": "const",
"possible_keys": ["PRIMARY", "c_status", "p_category_id"],
"key": "PRIMARY",
"key_length": "3",
"used_key_parts": ["category_id"],
"ref": ["const"],
"rows": 1,
"filtered": 100
},
"table": {
"table_name": "products_categories",
"access_type": "range",
"possible_keys": ["PRIMARY", "pt"],
"key": "PRIMARY",
"key_length": "6",
"used_key_parts": ["category_id", "product_id"],
"rows": 82,
"filtered": 1.527855396,
"attached_condition": "products_categories.category_id = 277 and products_categories.product_id <> 12601",
"using_index": true
},
"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.products_categories.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": "companies",
"access_type": "eq_ref",
"possible_keys": ["PRIMARY"],
"key": "PRIMARY",
"key_length": "4",
"used_key_parts": ["company_id"],
"ref": ["noframes_angrybeaver.products.company_id"],
"rows": 1,
"filtered": 100,
"attached_condition": "companies.`status` = 'A'"
},
"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": ["noframes_angrybeaver.products_categories.product_id"],
"rows": 1,
"filtered": 99.23484039,
"attached_condition": "prices.lower_limit = 1 and prices.usergroup_id in (0,0,1)"
},
"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.products_categories.product_id", "const"],
"rows": 1,
"filtered": 100,
"attached_condition": "trigcond(descr1.lang_code = 'ru')"
}
}
}
}
}
Result
| product_id |
product |
company_name |
product_type |
parent_product_id |
| 12546 |
Бельгийский ковер AGAT 200x300 |
NoFrames |
P |
0 |
| 12633 |
Бельгийский ковер Air 200x300 |
NoFrames |
P |
0 |
| 12573 |
Бельгийский ковер ANDROMEDA 200x300 |
NoFrames |
P |
0 |
| 12548 |
Бельгийский ковер ANTIQUE 160x230 |
NoFrames |
P |
0 |
| 12580 |
Бельгийский ковер ANTIQUE 80x125 |
NoFrames |
P |
0 |
| 12576 |
Бельгийский ковер APATITE 160x230 |
NoFrames |
P |
0 |
| 12565 |
Бельгийский ковер APATITE 200x300 |
NoFrames |
P |
0 |
| 12567 |
Бельгийский ковер APATITE 80x125 |
NoFrames |
P |
0 |
| 12549 |
Бельгийский ковер BASALT 160x230 |
NoFrames |
P |
0 |
| 12581 |
Бельгийский ковер BASALT 200x300 |
NoFrames |
P |
0 |
| 12557 |
Бельгийский ковер BAUHAUS 160х230 |
NoFrames |
P |
0 |
| 12558 |
Бельгийский ковер BAUHAUS 200x300 |
NoFrames |
P |
0 |
| 12570 |
Бельгийский ковер BAUHAUS 80x125 |
NoFrames |
P |
0 |
| 12568 |
Бельгийский ковер CARRARA 80x125 |
NoFrames |
P |
0 |
| 12547 |
Бельгийский ковер CHIC 200x300 |
NoFrames |
P |
0 |
| 12569 |
Бельгийский ковер CHIC 80x125 |
NoFrames |
P |
0 |
| 12584 |
Бельгийский ковер DJOTTO 160x230 |
NoFrames |
P |
0 |
| 12592 |
Бельгийский ковер DJOTTO 200x290 |
NoFrames |
P |
0 |
| 12575 |
Бельгийский ковер FLORENSE 160x230 |
NoFrames |
P |
0 |
| 12574 |
Бельгийский ковер FLORENSE 200x300 |
NoFrames |
P |
0 |