Bug #70782 | Query slow down and server overload when type parameter is wrong. | ||
---|---|---|---|
Submitted: | 31 Oct 2013 9:52 | Modified: | 6 Jul 2014 13:37 |
Reporter: | Alessio Palma | Email Updates: | |
Status: | No Feedback | Impact on me: | |
Category: | MySQL Server: Options | Severity: | S5 (Performance) |
Version: | 5.6.10-enterprise-commercial-advanced-lo | OS: | Linux (2.6.32-358.6.1.el6.x86_6) |
Assigned to: | CPU Architecture: | Any | |
Tags: | Query implicit conversion full table scan |
[31 Oct 2013 9:52]
Alessio Palma
[1 Nov 2013 6:14]
MySQL Verification Team
Did you see the warnings? mysql> explain extended select count(1) from att_transaction where ACTIVITY_ID = 9769718533; +----+-------------+-----------------+-------+---------------+-------------+---------+------+------+----------+--------------------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | filtered | Extra | +----+-------------+-----------------+-------+---------------+-------------+---------+------+------+----------+--------------------------+ | 1 | SIMPLE | att_transaction | index | ACTIVITY_ID | ACTIVITY_ID | 121 | NULL | 1 | 100.00 | Using where; Using index | +----+-------------+-----------------+-------+---------------+-------------+---------+------+------+----------+--------------------------+ 1 row in set, 3 warnings (0.00 sec) mysql> show warnings; +---------+------+----------------------------------------------------------------------------------------------------------------------------------------+ | Level | Code | Message | +---------+------+----------------------------------------------------------------------------------------------------------------------------------------+ | Warning | 1739 | Cannot use ref access on index 'ACTIVITY_ID' due to type or collation conversion on field 'ACTIVITY_ID' | | Warning | 1739 | Cannot use range access on index 'ACTIVITY_ID' due to type or collation conversion on field 'ACTIVITY_ID' | | Note | 1003 | /* select#1 */ select count(1) AS `count(1)` from `test`.`att_transaction` where (`test`.`att_transaction`.`ACTIVITY_ID` = 9769718533) | +---------+------+----------------------------------------------------------------------------------------------------------------------------------------+ 3 rows in set (0.00 sec)
[4 Nov 2013 7:47]
Alessio Palma
No, I did not see. I got it, however as long as 12.2. Type Conversion in Expression Evaluation When an operator is used with operands of different types, type conversion occurs to make the operands compatible. Some conversions occur implicitly. For example, MySQL automatically converts numbers to strings as necessary, and vice versa. I still wonder why mysqld is not able to use the index. If you just add "'" query runs faster. mysql> select count(1) from att_transaction where ACTIVITY_ID = 1; ... too long ... ^CCtrl-C -- sending "KILL QUERY 4080150" to server ... Ctrl-C -- query aborted. ERROR 1317 (70100): Query execution was interrupted mysql> select count(1) from att_transaction where ACTIVITY_ID = '1'; +----------+ | count(1) | +----------+ | 0 | +----------+ 1 row in set (0.00 sec) Should not be performed implicitly ?
[6 Jun 2014 13:37]
MySQL Verification Team
Please check 5.6.19. Thanks.
[7 Jul 2014 1:00]
Bugs System
No feedback was provided for this bug for over a month, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open".