Skip to content

Instantly share code, notes, and snippets.

@voxxit
Created June 25, 2009 20:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save voxxit/136132 to your computer and use it in GitHub Desktop.
Save voxxit/136132 to your computer and use it in GitHub Desktop.
# Without indexes
ForecastPoint Load (20.1ms) SELECT warning_date_time FROM `forecast_points` ORDER BY warning_date_time DESC LIMIT 1
ForecastPoint Load (11.7ms) SELECT * FROM `forecast_points` WHERE (`forecast_points`.`warning_date_time` = '2005-09-18 00:00:00')
# With a simple index on warning_date_time
ForecastPoint Load (0.4ms) SELECT warning_date_time FROM `forecast_points` ORDER BY warning_date_time DESC LIMIT 1
ForecastPoint Load (0.7ms) SELECT * FROM `forecast_points` WHERE (`forecast_points`.`warning_date_time` = '2005-09-18 00:00:00')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment