Skip to Main Content

Database Software


For appeals, questions and feedback, please email

rsiz(column) function like vsize(column) but return zero for NULLs

pudgeApr 5 2015 — edited Jan 11 2016

The ANSI standard requires Oracle to return NULL for vsize(column) when the column value is NULL. So it would be a waste of time to ask Oracle to change the return values for vsize(column) to be zero when in fact the NULL value storage for that column is zero. While it is a bit ironic that vsize is metadata about the value and we do definitely know the amount of storage required to store the NULL indication, it is unlikely the ANSI standard will ever be changed. A cover routine can be written, but taking the nvl to zero in a user routine is ridiculously expensive compared to Oracle supplying this builtin (rsiz). There is always a physical storage size for the current value of each column of each column. We should be able to get these values directly via a builtin so we can add, sum, multiply, and divide without expensively filtering NULLs that should have been zero (or some other value, I suppose if there are cases where storing the NULL requires more than zero bytes.

A bonus would be having this routine return the size of non-column overhead storage bytes for a row for, say, rsiz(-1).

Post Details
Added on Apr 5 2015