Writing Fast Queries
• Understanding how MySQL runs queries
• You need to think like MySQL does
• Some of its goals are…
– Eliminate as many rows as possible
– Use indexes where possible
– Avoid table scans
– Consider many join orders
– Avoid hitting the disk
– Avoid using the data records if the index has it
Copyright 2002, Jeremy Zawodny (Jeremy@Zawodny.com)