![]() You can understand what a query is spending time on by following the sequence diagram of the stages you get from profiling the query, where it's parsed, planned, executed and the result set is returned back to client. In chapter 3, we discussed ways to profile a query and get a better idea about which tasks it's performing. make it take a smaller amount of time to execute (minimize its response time) we will have to understand which tasks it's performing and either eliminate some of those tasks, make them happen less often or make them execute faster. ![]() Queries are broken up into a series of tasks that have to be performed in order to execute a query, so it follows that if we want to optimize a query, i.e. This chapter however is quite long and full of details, so to keep this article short, I will split it over 2 articles, so this is part 1. This chapter starts by some general considerations for query performance, a discussion of slow queries and the things to consider first when a query is not performing well, it then moves to discuss some query execution basics and a discussion of MySQL query execution engine and optimizer and finally it discusses how to optimize some specific types of queries. In last two chapters we discussed schema design optimization and indexing which are necessary for good performance but not solely enough as you still need to write optimized queries otherwise even with the best designed schema and indexes queries will not perform as well as expected. So the last article discussed chapter 5 of High Performance MySQL titled Indexing for High Performance. Today's article discusses chapter 6 titled Query Performance Optimization.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |