Query time 0.00050
JSON explain
{
"query_block": {
"select_id": 1,
"const_condition": "1",
"nested_loop": [
{
"table": {
"table_name": "cscart_discussion",
"access_type": "const",
"possible_keys": ["object_id", "idx_company_id"],
"key": "object_id",
"key_length": "10",
"used_key_parts": ["object_id", "object_type", "company_id"],
"ref": ["const", "const", "const"],
"rows": 1,
"filtered": 100
}
},
{
"table": {
"table_name": "cscart_discussion_posts",
"access_type": "ref",
"possible_keys": ["thread_id", "thread_id_2"],
"key": "thread_id_2",
"key_length": "6",
"used_key_parts": ["thread_id", "status"],
"ref": ["const", "const"],
"rows": 1,
"filtered": 100,
"attached_condition": "trigcond(cscart_discussion_posts.`status` = 'A')"
}
},
{
"table": {
"table_name": "cscart_discussion_rating",
"access_type": "eq_ref",
"possible_keys": ["PRIMARY", "thread_id"],
"key": "PRIMARY",
"key_length": "3",
"used_key_parts": ["post_id"],
"ref": ["lillyshop_lillyshop.cscart_discussion_posts.post_id"],
"rowid_filter": {
"range": {
"key": "thread_id",
"used_key_parts": ["thread_id"]
},
"rows": 1,
"selectivity_pct": 0.348432056
},
"rows": 1,
"filtered": 0.348432064,
"attached_condition": "trigcond(cscart_discussion_rating.thread_id = 11242 and cscart_discussion_rating.rating_value <> 0 and trigcond(cscart_discussion_posts.post_id is not null))"
}
}
]
}
}
Result
| product_id |
average_rating |
discussion_type |
discussion_thread_id |
| 10528 |
|
B |
11242 |