Bug #14093 | Query takes a lot of time when date format is not valid | ||
---|---|---|---|
Submitted: | 17 Oct 2005 23:36 | Modified: | 9 Nov 2005 4:02 |
Reporter: | jocelyn fournier (Silver Quality Contributor) | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Optimizer | Severity: | S2 (Serious) |
Version: | 5.0.13-rc/BK source | OS: | Linux (linux) |
Assigned to: | Evgeny Potemkin | CPU Architecture: | Any |
[17 Oct 2005 23:36]
jocelyn fournier
[17 Oct 2005 23:49]
jocelyn fournier
Note that running the server with option --sql_mode=ALLOW_INVALID_DATES solve the performance issue.
[21 Oct 2005 21:48]
Evgeny Potemkin
If date constant is valid then it's converted to internal integer representation and later compared with field as integer. Wrong values can't be converted and compared to field as a string, which is obviously slower.
[21 Oct 2005 23:54]
jocelyn fournier
Hi, I understand the new MySQL 5 behaviour is to not allow storing of invalid date by default, but comparing with invalid date is not something forbidden. In this case, why not converting the invalid field to '0000-00-00' internally (since it returns the same result anyway), it would speed up this kind of pre MySQL 5 queries a lot. (moreover it will not be obvious for a user to figure out why MySQL 5 is significantly slower with its application if he has not added checks in its website date form field for example). Thanks, Jocelyn
[27 Oct 2005 13:29]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/internals/31561
[3 Nov 2005 10:53]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/internals/31872
[3 Nov 2005 12:01]
Evgeny Potemkin
Invalid date like 2000-02-32 wasn't converted to int, which lead to not using index and comparison with field as astring, which results in slow query execution. Fixed in 5.0.16, cset 1.1939.10.1
[3 Nov 2005 14:43]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/internals/31887
[9 Nov 2005 4:02]
Paul DuBois
Noted in 5.0.16 changelog.