Performance boosts¶
InnoDB Buffer Pool Size¶
- Holds the data and indexes of tables in memory.
- Bigger buffer results in faster row lookups.
- The bigger the better, default is 8MB.
- Use InnoDB where it requires.
Query Cache¶
- Keeps the result of queries in memory until invalidated by writes.
query_cache_size
- total size of memory available to query caching, the default is 128 MB.query_cache_limit
- the maximum number of kilobytes one query can take up in the cache, default is 8MB.
Writing Queries¶
- When writing bad queries, the performance will be bad no matter the scale.
- Use
EXPLAIN
to profile the query execution plan - Use
DISTINCT
notGROUP BY
- Never use an indexed column with a function
- Avoid using functions in where clause
SSD¶
Use a Solid State Drives (SSD) for database servers as they are better for latency and access time than regular HDDs.