Gleb Paharenko wrote:
I'm not giving an exact answer on your question, however, it might be interesting for you. Usually queries are faster if you define the column as NOT NULL.
What's the reason behind this? NULL 'values' are a bit of strange phenomenon. In the EXPLAIN output a query with WHERE <col> NOT NULL; is of type 'range', which implies that NULL has a position in the range of values of the column. On the other hand UNIQUE indexes allow multiple NULL 'values' (except for BDB tables) and the storage space for various data types does not leave room for an extra 'value' in the range.
It almost seems as if NULL is stored as a kind of prefix in an index? Regards, Jigal. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]
