Query time 0.14908
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "340.21"
},
"ordering_operation": {
"using_filesort": true,
"grouping_operation": {
"using_temporary_table": true,
"using_filesort": false,
"nested_loop": [
{
"table": {
"table_name": "companies",
"access_type": "const",
"possible_keys": [
"PRIMARY",
"idx_status"
],
"key": "PRIMARY",
"used_key_parts": [
"company_id"
],
"key_length": "4",
"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": "14K"
},
"used_columns": [
"company_id",
"status",
"company",
"city",
"state",
"ag_hide_city"
]
}
},
{
"table": {
"table_name": "products",
"access_type": "index_merge",
"possible_keys": [
"PRIMARY",
"age_verification",
"status",
"idx_company_id",
"idx_usergroup_ids",
"idx_amount",
"index_products_on_deleted_at"
],
"key": "intersect(idx_company_id,status)",
"key_length": "4,3",
"rows_examined_per_scan": 404,
"rows_produced_per_join": 161,
"filtered": "39.95",
"cost_info": {
"read_cost": "201.97",
"eval_cost": "16.16",
"prefix_cost": "218.13",
"data_read_per_join": "682K"
},
"used_columns": [
"product_id",
"status",
"company_id",
"amount",
"usergroup_ids",
"tracking"
],
"attached_condition": "((`goimagine`.`products`.`company_id` = 2485) and ((`goimagine`.`products`.`amount` > 0) or (`goimagine`.`products`.`tracking` = 'D')) and ((`goimagine`.`products`.`usergroup_ids` = '') or (0 <> find_in_set(0,`goimagine`.`products`.`usergroup_ids`)) or (0 <> find_in_set(1,`goimagine`.`products`.`usergroup_ids`))) and (`goimagine`.`products`.`status` = 'A'))"
}
},
{
"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": [
"goimagine.products.product_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 41,
"filtered": "25.00",
"cost_info": {
"read_cost": "51.89",
"eval_cost": "4.19",
"prefix_cost": "286.76",
"data_read_per_join": "1004"
},
"used_columns": [
"id",
"product_id",
"lower_limit",
"usergroup_id"
],
"attached_condition": "((`goimagine`.`prices`.`lower_limit` = 1) and (`goimagine`.`prices`.`usergroup_id` in (0,0,1)))"
}
},
{
"table": {
"table_name": "products_categories",
"access_type": "ref",
"possible_keys": [
"PRIMARY",
"pt"
],
"key": "pt",
"used_key_parts": [
"product_id"
],
"key_length": "3",
"ref": [
"goimagine.products.product_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 80,
"filtered": "100.00",
"using_index": true,
"cost_info": {
"read_cost": "11.23",
"eval_cost": "8.00",
"prefix_cost": "305.99",
"data_read_per_join": "1K"
},
"used_columns": [
"product_id",
"category_id"
]
}
},
{
"table": {
"table_name": "categories",
"access_type": "eq_ref",
"possible_keys": [
"PRIMARY",
"c_status",
"p_category_id"
],
"key": "PRIMARY",
"used_key_parts": [
"category_id"
],
"key_length": "3",
"ref": [
"goimagine.products_categories.category_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 4,
"filtered": "5.00",
"cost_info": {
"read_cost": "20.01",
"eval_cost": "0.40",
"prefix_cost": "334.00",
"data_read_per_join": "10K"
},
"used_columns": [
"category_id",
"usergroup_ids",
"status",
"storefront_id"
],
"attached_condition": "(((`goimagine`.`categories`.`usergroup_ids` = '') or (0 <> find_in_set(0,`goimagine`.`categories`.`usergroup_ids`)) or (0 <> find_in_set(1,`goimagine`.`categories`.`usergroup_ids`))) and (`goimagine`.`categories`.`status` in ('A','H')) and (`goimagine`.`categories`.`storefront_id` in (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": "11",
"ref": [
"goimagine.products.product_id",
"const"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 4,
"filtered": "100.00",
"cost_info": {
"read_cost": "1.31",
"eval_cost": "0.40",
"prefix_cost": "335.71",
"data_read_per_join": "20K"
},
"used_columns": [
"product_id",
"lang_code",
"product"
]
}
},
{
"table": {
"table_name": "inventory",
"access_type": "ref",
"possible_keys": [
"pc"
],
"key": "pc",
"used_key_parts": [
"product_id"
],
"key_length": "3",
"ref": [
"goimagine.products.product_id"
],
"rows_examined_per_scan": 3,
"rows_produced_per_join": 13,
"filtered": "100.00",
"using_index": true,
"cost_info": {
"read_cost": "1.22",
"eval_cost": "1.36",
"prefix_cost": "338.29",
"data_read_per_join": "12K"
},
"used_columns": [
"product_id",
"combination_hash"
]
}
},
{
"table": {
"table_name": "popularity",
"access_type": "eq_ref",
"possible_keys": [
"PRIMARY",
"total"
],
"key": "PRIMARY",
"used_key_parts": [
"product_id"
],
"key_length": "3",
"ref": [
"goimagine.products.product_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 13,
"filtered": "100.00",
"cost_info": {
"read_cost": "0.56",
"eval_cost": "1.36",
"prefix_cost": "340.21",
"data_read_per_join": "435"
},
"used_columns": [
"product_id",
"total"
]
}
}
]
}
}
}
}
Result
| product_id |
product |
company_name |
company_city_hide |
company_city |
company_state |
| 93160 |
But will there be food? Sticker | Funny Decal | Vinyl Laptop Tumbler Die Cut Sticker Waterproof Vinyl Decal |
Heirloom Ink |
N |
Candor |
NC |
| 93167 |
Hydrangea Floral Sticker | Flower Decal | Vinyl Laptop Tumbler Die Cut Sticker Waterproof Vinyl Decal |
Heirloom Ink |
N |
Candor |
NC |
| 93200 |
Coffee Sticker | Cup of Coffee Laptop Sticker | I Love Coffee Tumbler Sticker | Die Cut Sticker Waterproof Vinyl Decal |
Heirloom Ink |
N |
Candor |
NC |
| 93243 |
Sea Turtle | Beach Sticker | Die Cut Sticker Waterproof Vinyl Decal |
Heirloom Ink |
N |
Candor |
NC |
| 93255 |
Faith Can Move Mountains Sticker | Christian Sticker | Die Cut Sticker Waterproof Vinyl Decal |
Heirloom Ink |
N |
Candor |
NC |
| 93170 |
Math Equation Sticker | Pi Math Sticker | I Heart Math Die Cut Sticker Waterproof Vinyl Decal |
Heirloom Ink |
N |
Candor |
NC |
| 93089 |
Leopard Star Sticker |
Heirloom Ink |
N |
Candor |
NC |
| 93246 |
True Crime Junkie Vinyl Sticker | My Favorite Murder | Laptop Sticker | Vinyl Decal |
Heirloom Ink |
N |
Candor |
NC |
| 93083 |
Peony Floral Sticker | Watercolor Flower Decal | Vinyl Laptop Tumbler Die Cut Sticker Waterproof Vinyl Decal |
Heirloom Ink |
N |
Candor |
NC |
| 93117 |
Blue Butterfly Vinyl Die Cut Decal Sticker | Laptop | Tumber | Cup | Water Bottle | Tablet | Car Decal |
Heirloom Ink |
N |
Candor |
NC |
| 93186 |
Vintage Camellia Floral Sticker | Flower Decal | Vinyl Laptop Tumbler Die Cut Sticker Waterproof Vinyl Decal |
Heirloom Ink |
N |
Candor |
NC |
| 93094 |
I'm Not a Hot Mess - I'm a Spicy Disaster Sticker | Funny Life Vinyl Laptop Tumbler Die Cut Sticker Waterproof Vinyl Decal |
Heirloom Ink |
N |
Candor |
NC |