Query time 0.00201
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "62.67"
},
"ordering_operation": {
"using_filesort": true,
"grouping_operation": {
"using_temporary_table": true,
"using_filesort": false,
"nested_loop": [
{
"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": "2.29",
"eval_cost": "0.20",
"prefix_cost": "2.49",
"data_read_per_join": "6K"
},
"used_columns": [
"company_id",
"status",
"company"
],
"attached_condition": "(`danishecarter_jan_demo`.`companies`.`status` = 'A')"
}
},
{
"table": {
"table_name": "cscart_categories",
"access_type": "index",
"possible_keys": [
"PRIMARY",
"c_status",
"p_category_id"
],
"key": "p_category_id",
"used_key_parts": [
"category_id",
"usergroup_ids",
"status"
],
"key_length": "773",
"rows_examined_per_scan": 86,
"rows_produced_per_join": 7,
"filtered": "8.14",
"using_index": true,
"using_join_buffer": "Block Nested Loop",
"cost_info": {
"read_cost": "19.39",
"eval_cost": "1.40",
"prefix_cost": "23.28",
"data_read_per_join": "18K"
},
"used_columns": [
"category_id",
"usergroup_ids",
"status"
],
"attached_condition": "((`danishecarter_jan_demo`.`cscart_categories`.`category_id` in (166,174,175,176,177,178,179,180,181,182,199,185,186,187,188,189,190,191,194,193,195,196,197,198,200,202,234,235,236,237,238,240,254,255,263)) and ((`danishecarter_jan_demo`.`cscart_categories`.`usergroup_ids` = '') or find_in_set(0,`danishecarter_jan_demo`.`cscart_categories`.`usergroup_ids`) or find_in_set(1,`danishecarter_jan_demo`.`cscart_categories`.`usergroup_ids`)) and (`danishecarter_jan_demo`.`cscart_categories`.`status` in ('A','H')))"
}
},
{
"table": {
"table_name": "products_categories",
"access_type": "ref",
"possible_keys": [
"PRIMARY",
"pt"
],
"key": "PRIMARY",
"used_key_parts": [
"category_id"
],
"key_length": "3",
"ref": [
"danishecarter_jan_demo.cscart_categories.category_id"
],
"rows_examined_per_scan": 3,
"rows_produced_per_join": 20,
"filtered": "98.51",
"using_index": true,
"cost_info": {
"read_cost": "7.41",
"eval_cost": "4.14",
"prefix_cost": "34.89",
"data_read_per_join": "331"
},
"used_columns": [
"product_id",
"category_id"
],
"attached_condition": "(`danishecarter_jan_demo`.`products_categories`.`product_id` <> 450)"
}
},
{
"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": [
"danishecarter_jan_demo.products_categories.product_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 1,
"filtered": "5.00",
"cost_info": {
"read_cost": "20.69",
"eval_cost": "0.21",
"prefix_cost": "59.71",
"data_read_per_join": "5K"
},
"used_columns": [
"product_id",
"product_type",
"status",
"company_id",
"amount",
"usergroup_ids",
"tracking",
"parent_product_id"
],
"attached_condition": "((`danishecarter_jan_demo`.`products`.`company_id` = `danishecarter_jan_demo`.`companies`.`company_id`) and (`danishecarter_jan_demo`.`products`.`parent_product_id` = 0) and ((`danishecarter_jan_demo`.`products`.`amount` > 0) or (`danishecarter_jan_demo`.`products`.`tracking` = 'D')) and ((`danishecarter_jan_demo`.`products`.`usergroup_ids` = '') or find_in_set(0,`danishecarter_jan_demo`.`products`.`usergroup_ids`) or find_in_set(1,`danishecarter_jan_demo`.`products`.`usergroup_ids`)) and (`danishecarter_jan_demo`.`products`.`status` = 'A') and (`danishecarter_jan_demo`.`products`.`product_type` <> 'D'))"
}
},
{
"table": {
"table_name": "prices",
"access_type": "ref",
"possible_keys": [
"usergroup",
"product_id",
"lower_limit",
"usergroup_id"
],
"key": "usergroup",
"used_key_parts": [
"product_id"
],
"key_length": "3",
"ref": [
"danishecarter_jan_demo.products_categories.product_id"
],
"rows_examined_per_scan": 2,
"rows_produced_per_join": 0,
"filtered": "29.25",
"using_index": true,
"cost_info": {
"read_cost": "1.09",
"eval_cost": "0.12",
"prefix_cost": "61.22",
"data_read_per_join": "14"
},
"used_columns": [
"product_id",
"lower_limit",
"usergroup_id"
],
"attached_condition": "((`danishecarter_jan_demo`.`prices`.`lower_limit` = 1) and (`danishecarter_jan_demo`.`prices`.`usergroup_id` in (0,0,1)))"
}
},
{
"table": {
"table_name": "cscart_product_review_prepared_data",
"access_type": "eq_ref",
"possible_keys": [
"PRIMARY"
],
"key": "PRIMARY",
"used_key_parts": [
"product_id",
"storefront_id"
],
"key_length": "7",
"ref": [
"danishecarter_jan_demo.products_categories.product_id",
"const"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 0,
"filtered": "100.00",
"cost_info": {
"read_cost": "0.61",
"eval_cost": "0.12",
"prefix_cost": "61.94",
"data_read_per_join": "9"
},
"used_columns": [
"product_id",
"storefront_id",
"average_rating",
"reviews_count"
]
}
},
{
"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": [
"danishecarter_jan_demo.products_categories.product_id",
"const"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 0,
"filtered": "100.00",
"cost_info": {
"read_cost": "0.61",
"eval_cost": "0.12",
"prefix_cost": "62.67",
"data_read_per_join": "2K"
},
"used_columns": [
"product_id",
"lang_code",
"product"
]
}
}
]
}
}
}
}
Result
product_id |
product |
company_name |
product_type |
parent_product_id |
average_rating |
product_reviews_count |
453 |
Brown bear - Vector graphics |
ACME Corp |
P |
0 |
|
|
454 |
Hummingbird - Vector graphics |
ACME Corp |
P |
0 |
|
|
445 |
Hummingbird printed sweater |
ACME Corp |
P |
0 |
|
|
437 |
Hummingbird printed t-shirt |
ACME Corp |
P |
0 |
|
|