Comments on: Beware of implicit casting https://shlomi-noach.github.io/blog/mysql/beware-of-implicit-casting Blog by Shlomi Noach Wed, 27 Jul 2011 18:16:08 +0000 hourly 1 https://wordpress.org/?v=5.3.3 By: 23:59:59 is not the end of the day. No, really! | code.openark.org https://shlomi-noach.github.io/blog/mysql/beware-of-implicit-casting/comment-page-1#comment-47206 Wed, 27 Jul 2011 18:16:08 +0000 https://shlomi-noach.github.io/blog/?p=1886#comment-47206 […] do not use LIKE ’2011-07-26 %’. Read this if you’re not sure […]

]]>
By: Implicit casting you don’t want to see around | code.openark.org https://shlomi-noach.github.io/blog/mysql/beware-of-implicit-casting/comment-page-1#comment-15535 Wed, 07 Jul 2010 08:53:41 +0000 https://shlomi-noach.github.io/blog/?p=1886#comment-15535 […] Beware of implicit casting […]

]]>
By: 11 MySQL resources you must read! https://shlomi-noach.github.io/blog/mysql/beware-of-implicit-casting/comment-page-1#comment-10426 Tue, 09 Feb 2010 17:52:07 +0000 https://shlomi-noach.github.io/blog/?p=1886#comment-10426 […] Beware of implicit casting Ever so often a query provides a “bad” execution plan. Adding a missing index can many times solve the problem. However, not everything can be solved with an index. I wish to highlight the point of having an implicit cast, which negates the use of an index on MySQL. […]

]]>
By: shlomi https://shlomi-noach.github.io/blog/mysql/beware-of-implicit-casting/comment-page-1#comment-10235 Thu, 04 Feb 2010 05:26:01 +0000 https://shlomi-noach.github.io/blog/?p=1886#comment-10235 @sbester
Thank you

@Kedare,
driver_license_Registration being an example only; an integer column also has the advantage of low storage requirements, so it’s not all about arithmetics.
But you are right in suggesting this may be the right solution, as I also suggest above. Just note that this may affect other tables as well, which may join to this table using this column.

]]>
By: Kedare https://shlomi-noach.github.io/blog/mysql/beware-of-implicit-casting/comment-page-1#comment-10214 Wed, 03 Feb 2010 23:04:57 +0000 https://shlomi-noach.github.io/blog/?p=1886#comment-10214 I recommend you to convert the “driver_license_registration” column to a CHAR/VARCHAR column, numeric fields is just required when you need arithmetic operations (that’s not the case here… I think)

]]>
By: sbester https://shlomi-noach.github.io/blog/mysql/beware-of-implicit-casting/comment-page-1#comment-10177 Wed, 03 Feb 2010 07:29:37 +0000 https://shlomi-noach.github.io/blog/?p=1886#comment-10177 beware of joining two tables on columns with different collations/charsets. these won’t use an index either.
EXPLAIN EXTENDED followed by SHOW WARNINGS will allow you to catch these cases, since there will be a CONVERT function used…

]]>