Know MySQL's strengths

Although MySQL is a fast DBMS all-round, there are some things it does particularly well. We have covered the majority here, but there is one particular optimisation you should be aware of, and that is that the following syntax is particularly fast:

SELECT foo FROM bar WHERE baz IN (constant1, constant2, constant3);

This holds true even if you have a fairly long list of constants for the IN clause.


Want to learn PHP 7?

Hacking with PHP has been fully updated for PHP 7, and is now available as a downloadable PDF. Get over 1200 pages of hands-on PHP learning today!

If this was helpful, please take a moment to tell others about Hacking with PHP by tweeting about it!

Next chapter: Server >>

Previous chapter: Benchmark, benchmark, benchmark!

Jump to:


Home: Table of Contents

Copyright ©2015 Paul Hudson. Follow me: @twostraws.