Sunday, October 21, 2007

More MySQL weirdness - When is a boolean not a boolean?

Here's another MySQL performance oddity I've noticed; a really weird one, this time.

Create a table with a large amount of data in it, and at least one column which can have a value of either 0 or 1. Run lots of SELECTs against it based (in whole or part) on the value of that column. Now try doing the same, but with TRUE or FALSE. You'll notice (or at least may notice; it's possible that it was chance or experimental error on my part) that the second way is slower. EXPLAIN shows nothing weird...

My only guess is that it's a query compilation thing, but I really wouldn't expect it to behave that way, even so.


No comments:

Post a Comment