This site is currently read-only as we are migrating to Oracle Forums for an improved community experience. You will not be able to initiate activity until January 30th, when you will be able to use this site as normal.

    Forum Stats

  • 3,890,033 Users
  • 2,269,775 Discussions
  • 7,916,823 Comments

Discussions

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

pudge
pudge Member Posts: 60
edited Jan 11, 2016 5:59PM in Database Ideas - Ideas

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).

pudgectriebManish Chaturvediabhinivesh.jainLothar Flatzvinaykumar2
8 votes

Active · Last Updated