Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Some top tips from <a href="http://forge.mysql.com/wiki/Top10SQLPerformanceTips" rel="nofollow noreferrer">MySQL Performance tips forge</a></p> <p><strong>Specific Query Performance:</strong></p> <ol> <li>Use EXPLAIN to profile the query execution plan</li> <li>Use Slow Query Log (always have it on!)</li> <li>Don't use DISTINCT when you have or could use GROUP BY Insert performance</li> <li>Batch INSERT and REPLACE</li> <li>Use LOAD DATA instead of INSERT</li> <li>LIMIT m,n may not be as fast as it sounds</li> <li>Don't use ORDER BY RAND() if you have > ~2K records</li> <li>Use SQL_NO_CACHE when you are SELECTing frequently updated data or large sets of data</li> <li>Avoid wildcards at the start of LIKE queries</li> <li>Avoid correlated subqueries and in select and where clause (try to avoid in)</li> </ol> <p><strong>Scaling Performance Tips:</strong></p> <ol> <li>Use benchmarking</li> <li>isolate workloads don't let administrative work interfere with customer performance. (ie backups)</li> <li>Debugging sucks, testing rocks!</li> <li>As your data grows, indexing may change (cardinality and selectivity change). Structuring may want to change. Make your schema as modular as your code. Make your code able to scale. Plan and embrace change, and get developers to do the same. </li> </ol> <p><strong>Network Performance Tips:</strong></p> <ol> <li>Minimize traffic by fetching only what you need. 1. Paging/chunked data retrieval to limit 2. Don't use SELECT * 3. Be wary of lots of small quick queries if a longer query can be more efficient </li> <li>Use multi_query if appropriate to reduce round-trips</li> <li>Use stored procedures to avoid bandwidth wastage </li> </ol> <p><strong>OS Performance Tips:</strong></p> <ol> <li>Use proper data partitions 1. For Cluster. Start thinking about Cluster <em>before</em> you need them </li> <li>Keep the database host as clean as possible. Do you really need a windowing system on that server?</li> <li>Utilize the strengths of the OS</li> <li>pare down cron scripts</li> <li>create a test environment</li> </ol>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload