Oracle8i Application Developer's Guide - Large Objects (LOBs) Release 2 (8.1.6) Part Number A76940-01 |
|
Frequently Asked Questions, 9 of 11
What happens if I specify a LOB TABLESPACE, but also say ENABLE STORAGE IN ROW?
If the length of the LOB value is less than approximately 4K, then the data is stored inline in the table. When it grows to beyond approximately 4K, then the LOB value is moved to the specified tablespace.
I am looking for information on the pros and cons of storing images in a BFILE versus a BLOB.
Here's some basic information.
Should DISABLE STORAGE IN ROW
always be specified if many UPDATEs, or SELECTs including full table scans are anticipated?
Use DISABLE STORAGE IN ROW
if the other table data will be updated or selected frequently, not if the LOB data is updated or selected frequently.
If I specify a segment and tablespace for the BLOB, and specify ENABLE STORAGE IN ROW
then look in USER_LOBS, I see that the BLOB is defined as IN_ROW and it shows that it has a segment specified. What does this mean? That all BLOBs 4K and under will go into the same segment as the table data, but the ones larger than that go into the segment I specified?
Yes.
Release 8.1.5 Oracle8i SQL Reference, Chapter 4, states the following:
"ENABLE STORAGE IN ROW--specifies that the LOB value is stored in the row (inline) if its length is less than approximately 4K bytes minus system control information. This is the default. "
If an inline LOB is > 4K, which of the following possibilities is true?
It sounds to me like #2, but I need to check.
You are correct -- it's number 2. Some meta information is stored inline in the row so that accessing the LOB value is faster. However, the entire LOB value is stored elsewhere once it grows beyond approximately 4K bytes.
INSERT INTO blob_table (key, blob_column) VALUES (1, null);
In this case I expect that you do not use any space, like any other NULL value, as we do not have any pointer to a BLOB value at all.
INSERT INTO blob_table (key, blob_column) VALUES (1, empty_blob());
In this case you would be right, that we need at least a chunk size of space.
We distinguish between when we use BLOBs between NULL values and empty strings.
If a LOB column is EMPTY_CLOB() or EMPTY_BLOB() instead of NULL, how is the LOB locator stored in the row and are extra data blocks used for this?
See also Chapter 7, "Modeling and Design", in this manual, under "LOB Storage".
You can run a simple test that creates a table with a LOB column with attribute DISABLE STORAGE IN ROW
. Insert thousands of rows with NULL LOBs.
Note that Oracle8i does not consume thousands of chunks to store NULLs!
|
![]() Copyright © 1996-2000, Oracle Corporation. All Rights Reserved. |
|