Tuesday, 3 December 2013

Using fake values for NULL is a BAD idea

Quote from Tom Kyte


But what does this have to do with NULL values? Nothing really—it has to do with what can happen when developers do not use a NULL value when they should have. Many times developers fear using NULLs: they do not understand them, and they do not believe they can be indexed, so they avoid them. They will use a “fake” value—such as 01-JAN-9999—to represent a missing date value. This is a bad idea for many reasons; the first I’ll show you is how it can throw off cardinality estimates.

Taken from 
http://www.oracle.com/technetwork/issue-archive/2012/12-nov/o62asktom-1867739.html

No comments: