Home > database >  How big is an Oracle CLOB when stored in database?
How big is an Oracle CLOB when stored in database?

Time:12-05

If I have a table like this

id  |   CLOB         | Title
1   | Text,Text,Te...| Tom Sawyer
2   | null           | Illustration

and the "CLOB" field will often be empty. What will happen? Memory will be wasted on a null-valued string? if yes, how much?

CodePudding user response:

"Memory" and "stored in the database" generally have nothing to do with each other; data is stored on disk, not in memory (unless you have an in-memory database).

Regardless: if a CLOB is empty, or a short string, it only uses very little space - either when stored on disk or when copied to memory for processing. There is a CLOB locator (a pointer to where the actual data is stored) that will always exist, and the actual location where the CLOB is stored. Only as much space is used as the actual data requires - there is no "huge wasted space".

  • Related