SQL SELECT-WHERE instruction performance evaluation
The better performance way example:
SELECT sb_id, sb_start FROM subscriptions
WHERE sb_start >= '2012-06-01'
AND sb_start < '2012-09-01'
The worse performance way example:
SELECT sb_id, sb_start FROM subscriptions
WHERE YEAR(sb_start) = 2012
AND MONTH(sb_start) BETWEEN 6 AND
Median 100 query retry times for a table with a million records:
We got at least 1.5 times performances decreasing when exchange comparation of dates with MONTH and YEAR comparation. But in common case we operate with non full month periods and such solution approach is not available.
Комментарии
Отправить комментарий