Some statements which are related ...
We got this both queries:
mysql> explain select count(downloadco0_.id) as col_0_0_ from DownloadConfirmation downloadco0_ where downloadco0_.platform='EU' and downloadco0_.fulfillerId='5' and (downloadco0_.downloadCompleted is null);
+----+-------------+--------------+------+--------------------------------+--------------------------------+---------+-------------+--------+------------------------------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+--------------+------+--------------------------------+--------------------------------+---------+-------------+--------+------------------------------------+
| 1 | SIMPLE | downloadco0_ | ref | platformFulfillerIdExecutionId | platformFulfillerIdExecutionId | 773 | const,const | 403364 | Using index condition; Using where |
+----+-------------+--------------+------+--------------------------------+--------------------------------+---------+-------------+--------+------------------------------------+
1 row in set (0.00 sec)
mysql> explain select downloadco0_.id as id1_9_, downloadco0_.attempts as attempts2_9_, downloadco0_.dateCreated as dateCrea3_9_, downloadco0_.dateModified as dateModi4_9_, downloadco0_.downloadCompleted as download5_9_, downloadco0_.downloadStarted as download6_9_, downloadco0_.executionId as executio7_9_, downloadco0_.fileId as fileId8_9_, downloadco0_.fileSize as fileSize9_9_, downloadco0_.fulfillerId as fulfill10_9_, downloadco0_.platform as platfor11_9_ from DownloadConfirmation downloadco0_ where downloadco0_.platform='EU' and downloadco0_.fulfillerId='12' and downloadco0_.executionId='103906' and (downloadco0_.downloadCompleted is not null) order by downloadco0_.downloadCompleted asc limit 1;
+----+-------------+--------------+------+--------------------------------+--------------------------------+---------+-------------------+------+----------------------------------------------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+--------------+------+--------------------------------+--------------------------------+---------+-------------------+------+----------------------------------------------------+
| 1 | SIMPLE | downloadco0_ | ref | platformFulfillerIdExecutionId | platformFulfillerIdExecutionId | 824 | const,const,const | 977 | Using index condition; Using where; Using filesort |
+----+-------------+--------------+------+--------------------------------+--------------------------------+---------+-------------------+------+----------------------------------------------------+
1 row in set (0.00 sec)
Some statements which are related ...
We got this both queries:
mysql> explain select count(downloadc o0_.id) as col_0_0_ from DownloadConfirm ation downloadco0_ where downloadco0_ .platform= 'EU' and downloadco0_ .fulfillerId= '5' and (downloadco0_ .downloadComple ted is null); ------- -----+- ------- ------+ ------+ ------- ------- ------- ------- ----+-- ------- ------- ------- ------- --+---- -----+- ------- -----+- ------- +------ ------- ------- ------- ------- --+ ------- -----+- ------- ------+ ------+ ------- ------- ------- ------- ----+-- ------- ------- ------- ------- --+---- -----+- ------- -----+- ------- +------ ------- ------- ------- ------- --+ erIdExecutionId | platformFulfill erIdExecutionId | 773 | const,const | 403364 | Using index condition; Using where | ------- -----+- ------- ------+ ------+ ------- ------- ------- ------- ----+-- ------- ------- ------- ------- --+---- -----+- ------- -----+- ------- +------ ------- ------- ------- ------- --+
+----+-
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-
| 1 | SIMPLE | downloadco0_ | ref | platformFulfill
+----+-
1 row in set (0.00 sec)
mysql> explain select downloadco0_.id as id1_9_, downloadco0_ .attempts as attempts2_9_, downloadco0_ .dateCreated as dateCrea3_9_, downloadco0_ .dateModified as dateModi4_9_, downloadco0_ .downloadComple ted as download5_9_, downloadco0_ .downloadStarte d as download6_9_, downloadco0_ .executionId as executio7_9_, downloadco0_.fileId as fileId8_9_, downloadco0_ .fileSize as fileSize9_9_, downloadco0_ .fulfillerId as fulfill10_9_, downloadco0_ .platform as platfor11_9_ from DownloadConfirm ation downloadco0_ where downloadco0_ .platform= 'EU' and downloadco0_ .fulfillerId= '12' and downloadco0_ .executionId= '103906' and (downloadco0_ .downloadComple ted is not null) order by downloadco0_ .downloadComple ted asc limit 1; ------- -----+- ------- ------+ ------+ ------- ------- ------- ------- ----+-- ------- ------- ------- ------- --+---- -----+- ------- ------- ----+-- ----+-- ------- ------- ------- ------- ------- ------- ------- -+ ------- -----+- ------- ------+ ------+ ------- ------- ------- ------- ----+-- ------- ------- ------- ------- --+---- -----+- ------- ------- ----+-- ----+-- ------- ------- ------- ------- ------- ------- ------- -+ erIdExecutionId | platformFulfill erIdExecutionId | 824 | const,const,const | 977 | Using index condition; Using where; Using filesort | ------- -----+- ------- ------+ ------+ ------- ------- ------- ------- ----+-- ------- ------- ------- ------- --+---- -----+- ------- ------- ----+-- ----+-- ------- ------- ------- ------- ------- ------- ------- -+
+----+-
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-
| 1 | SIMPLE | downloadco0_ | ref | platformFulfill
+----+-
1 row in set (0.00 sec)