Query time 0.00321
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "11.28"
},
"ordering_operation": {
"using_filesort": true,
"grouping_operation": {
"using_temporary_table": true,
"using_filesort": true,
"buffer_result": {
"using_temporary_table": true,
"nested_loop": [
{
"table": {
"table_name": "ushop_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": "3K"
},
"used_columns": [
"category_id",
"storefront_id",
"usergroup_ids",
"status"
]
}
},
{
"table": {
"table_name": "companies",
"access_type": "ALL",
"possible_keys": [
"PRIMARY"
],
"rows_examined_per_scan": 7,
"rows_produced_per_join": 0,
"filtered": "14.29",
"cost_info": {
"read_cost": "1.17",
"eval_cost": "0.10",
"prefix_cost": "1.27",
"data_read_per_join": "6K"
},
"used_columns": [
"company_id",
"status",
"company"
],
"attached_condition": "(`marketplace`.`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": 17,
"rows_produced_per_join": 16,
"filtered": "100.00",
"using_index": true,
"cost_info": {
"read_cost": "0.35",
"eval_cost": "1.70",
"prefix_cost": "3.32",
"data_read_per_join": "271"
},
"used_columns": [
"product_id",
"category_id"
]
}
},
{
"table": {
"table_name": "products",
"access_type": "eq_ref",
"possible_keys": [
"PRIMARY",
"status"
],
"key": "PRIMARY",
"used_key_parts": [
"product_id"
],
"key_length": "3",
"ref": [
"marketplace.products_categories.product_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 1,
"filtered": "7.87",
"cost_info": {
"read_cost": "4.25",
"eval_cost": "0.13",
"prefix_cost": "9.27",
"data_read_per_join": "5K"
},
"used_columns": [
"product_id",
"product_type",
"status",
"company_id",
"usergroup_ids",
"parent_product_id",
"cp_active_auction_id"
],
"attached_condition": "((`marketplace`.`products`.`company_id` = `marketplace`.`companies`.`company_id`) and ((`marketplace`.`products`.`usergroup_ids` = '') or (0 <> find_in_set(0,`marketplace`.`products`.`usergroup_ids`)) or (0 <> find_in_set(1,`marketplace`.`products`.`usergroup_ids`))) and (`marketplace`.`products`.`status` = 'A') and (`marketplace`.`products`.`product_type` <> 'W') and (`marketplace`.`products`.`product_type` <> 'D'))"
}
},
{
"table": {
"table_name": "auctions",
"access_type": "ref",
"possible_keys": [
"product_id"
],
"key": "product_id",
"used_key_parts": [
"product_id"
],
"key_length": "4",
"ref": [
"marketplace.products_categories.product_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 1,
"filtered": "100.00",
"index_condition": "<if>(is_not_null_compl(auctions), (`marketplace`.`products_categories`.`product_id` = `marketplace`.`auctions`.`product_id`), true)",
"cost_info": {
"read_cost": "0.33",
"eval_cost": "0.13",
"prefix_cost": "9.73",
"data_read_per_join": "278"
},
"used_columns": [
"product_id",
"users",
"show_on_category"
]
}
},
{
"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": [
"marketplace.products_categories.product_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 1,
"filtered": "98.81",
"cost_info": {
"read_cost": "0.33",
"eval_cost": "0.13",
"prefix_cost": "10.20",
"data_read_per_join": "31"
},
"used_columns": [
"product_id",
"lower_limit",
"usergroup_id"
],
"attached_condition": "((`marketplace`.`prices`.`lower_limit` = 1) and (`marketplace`.`prices`.`usergroup_id` in (0,0,1)))"
}
},
{
"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": [
"marketplace.products_categories.product_id",
"const"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 1,
"filtered": "100.00",
"cost_info": {
"read_cost": "0.33",
"eval_cost": "0.13",
"prefix_cost": "10.67",
"data_read_per_join": "8K"
},
"used_columns": [
"product_id",
"lang_code",
"product"
]
}
},
{
"table": {
"table_name": "ushop_users",
"access_type": "const",
"possible_keys": [
"PRIMARY"
],
"key": "PRIMARY",
"used_key_parts": [
"user_id"
],
"key_length": "3",
"ref": [
"const"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 1,
"filtered": "100.00",
"cost_info": {
"read_cost": "0.02",
"eval_cost": "0.13",
"prefix_cost": "10.82",
"data_read_per_join": "8K"
},
"used_columns": [
"user_id",
"user_type",
"company_id"
],
"attached_condition": "(<if>(found_match(ushop_users), ((0 <> (case when (`marketplace`.`products`.`cp_active_auction_id` > 0) then (((`marketplace`.`auctions`.`users` = '') or (0 <> find_in_set(0,`marketplace`.`auctions`.`users`))) and (`marketplace`.`auctions`.`show_on_category` = 'Y')) else 1 end)) or (`marketplace`.`ushop_users`.`company_id` = `marketplace`.`companies`.`company_id`)), true) and <if>(is_not_null_compl(ushop_users), ((`marketplace`.`ushop_users`.`company_id` = `marketplace`.`companies`.`company_id`) and (`marketplace`.`ushop_users`.`user_type` = 'V')), true))"
}
},
{
"table": {
"table_name": "popularity",
"access_type": "eq_ref",
"possible_keys": [
"PRIMARY",
"total"
],
"key": "PRIMARY",
"used_key_parts": [
"product_id"
],
"key_length": "3",
"ref": [
"marketplace.products_categories.product_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 1,
"filtered": "100.00",
"cost_info": {
"read_cost": "0.33",
"eval_cost": "0.13",
"prefix_cost": "11.28",
"data_read_per_join": "42"
},
"used_columns": [
"product_id",
"total"
]
}
}
]
}
}
}
}
}
Result
| product_id |
product |
company_name |
product_ids |
product_types |
parent_product_ids |
product_type |
parent_product_id |
| 428 |
16GB A Series Walkman Video MP3 |
Ferrequipo |
428 |
P |
0 |
P |
0 |
| 307 |
5.1 Channel Blu-ray 3D Home Theater System |
Ferrequipo |
307 |
P |
0 |
P |
0 |
| 429 |
8GB E Series Walkman Video MP3 |
Ferrequipo |
429 |
P |
0 |
P |
0 |
| 415 |
Creative ZEN Touch 2 MP3 Player 8GB (Black) |
Ferrequipo |
415 |
P |
0 |
P |
0 |
| 424 |
Yamaha PDX-30BU |
Ferrequipo |
424 |
P |
0 |
P |
0 |
| 421 |
Yamaha PDX-11 GR |
Ferrequipo |
421 |
P |
0 |
P |
0 |
| 308 |
5.1 Channel Blu-ray 3D Home Theater System |
Ferrequipo |
308 |
P |
0 |
P |
0 |
| 309 |
HW-D7000 AV Receiver with built-in Blu-ray DiscĀ® Player |
Ferrequipo |
309 |
P |
0 |
P |
0 |
| 306 |
7.1 Channel Blu-ray 3D Home Theater System |
Ferrequipo |
306 |
P |
0 |
P |
0 |
| 414 |
Creative ZEN Style M300 MP3 Player 16GB (Black) |
Ferrequipo |
414 |
P |
0 |
P |
0 |
| 426 |
Sansa Clip+ MP3 Player (Blue) - 4GB |
Ferrequipo |
426 |
P |
0 |
P |
0 |
| 425 |
Sansa Fuze+ MP3 Player (Red) - 4GB |
ACME Corp |
425 |
P |
0 |
P |
0 |
| 423 |
Yamaha PDX-30PI |
Ferrequipo |
423 |
P |
0 |
P |
0 |
| 422 |
Yamaha TSX-130WH |
Ferrequipo |
422 |
P |
0 |
P |
0 |
| 420 |
Yamaha PDX-11 DB |
Ferrequipo |
420 |
P |
0 |
P |
0 |
| 412 |
Samsung Galaxy Player 5.0 |
Ferrequipo |
412 |
P |
0 |
P |
0 |
| 413 |
Samsung Galaxy Player 4.0 |
Ferrequipo |
413 |
P |
0 |
P |
0 |
| 427 |
Sansa Clip+ MP3 Player (Red) - 4GB |
Ferrequipo |
427 |
P |
0 |
P |
0 |