4/29/2023 0 Comments Mysql optimizer traceI have heard many users say "joins are slow", but a broad statement like this misses magnitude. These queries are not identical in cost even though they are in EXPLAIN output. ![]() With the FORMAT=JSON output also showing cost, we can see that two ranges costs 10.04, versus one big range costing 9.04 (not shown). The JSON output will now include cost information (as well as showing separate ranges as attached_condition): EXPLAIN FORMAT=JSONĮXPLAIN FORMAT=JSON was introduced in MySQL 5.6 along with OPTIMIZER TRACE, but where it really becomes useful is MySQL 5.7. It should be possible to distinguish between the two. Two distinct separate ranges may be two separate pages, and thus have different cache efficiency on the buffer pool. EXPLAIN will not show this difference, and both queries appear the same: It's pretty obvious that the second one needs to execute in two separate ranges.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |