有一个mysql查询,我想了解它是如何执行的。
SELECT COUNT(abet.id) AS count,
IF(abet.b_t <= 1396047600000 AND abet.e_t >= 1396047600000, '2014-03-29 00:00:00.0 CET',
IF(abet.b_t <= 1396047600000 AND abet.e_t >= 1396047600000, '2014-03-29 01:00:00.0 CET',
IF(abet.b_t <= 1396054800000 AND abet.e_t >= 1396054800000, '2014-03-29 02:00:00.0 CET','0'))) AS _index
FROM a_b_e_t AS abet
INNER JOIN a_s AS a
ON a.id = abet.a_s AND a.u IN (4, 3, 2, 1)
GROUP BY _index
我认为当在服务器中执行此操作时,数据集将通过WHERE子句最小化,并在最小化的数据集上逐行检查if条件并且计数器将适当增加,即使第二个IF对IF上面的IF处理的数据有效,也不会考虑到这一点,对吗?
换句话说,数据集中的一行被一个人考虑,不会被另一个人考虑,是这样吗?