Example 1: querying once to get the number of results, then a second time
to get the actual results.
Example 2: When searching by name and a full state, compare the following
queries:
// Runs in 30 seconds
SELECT COUNT(*) FROM Voters
WHERE ( lname = 'Gates' ) AND (Voters.CountyID between '02959' and
'02991')
// Runs in 5 seconds
SELECT COUNT(*) FROM Voters USE INDEX (idx_CountyAndName)
WHERE ( lname = 'Gates' ) AND (Voters.CountyID between '02959' and
'02991')
Nobody/Anonymous
None
None
Public
Copyright © 2009 Geeknet, Inc. All rights reserved. Terms of Use