Mysql speed up query8/18/2023 ![]() You want this column to show an index and, when it does, it will give you optimal speed. Since the extra column does not specify an index then data needs to be collected outside of what is available in the index. For the above query, there are two tables being used (one for each returned row) and indexes are available. ![]() This really hurts you if there are a large number of results. A filesort means the database has to do an extra query after the data is retrieved. If you have a filesort, that query is going to be slow so fix that first. This will tell you if you are using indexes or the dreaded filesort. Pay attention to the last column (it is labeled 'extra'). Mysql> EXPLAIN SELECT * FROM testplan_iov_item_result iovrġ SIMPLE iovr ref key_unique,index_1 index_1 4 const 876ġ SIMPLE iov eq_ref PRIMARY PRIMARY 4 cxw_project_item_num 1 Using where Run EXPLAIN "SQL STATEMENT" for each of the slow queries to see how the database will be running the queries. # This item is included in the report because it matches -limit. # Query 1: 0 QPS, 0x concurrency, ID 0x5CBA2034458B5BC9 at byte 0 _ # Rank Query ID Response time Calls R/Call V/M Item # Attribute total min max avg 95% stddev median ![]()
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |