Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Leaf Block Dump - more columns?

538022Jul 12 2007 — edited Jul 12 2007
Hello guys,
i tested something around with B-Tree indexes and NULL values in columns.

Here is a little test scenario.
----------------------------------------------------------------------------------------------------------------
create table INDEX_TEST (
F0 NUMBER,
F1 VARCHAR2(20),
F2 VARCHAR2(20),
F3 NUMBER);
BEGIN
FOR i in 1 .. 200 LOOP
INSERT INTO INDEX_TEST VALUES(i,NULL,NULL,NULL);
END LOOP;
COMMIT;

END;

CREATE INDEX INDEX_TEST_01 ON INDEX_TEST(F0);
CREATE INDEX INDEX_TEST_02 ON INDEX_TEST(F0,F1);
CREATE INDEX INDEX_TEST_03 ON INDEX_TEST(F1);
----------------------------------------------------------------------------------------------------------------

After that i block dumped the indeces and have a look at null values in the leaf blocks.

At first i looked at index INDEX_TEST_01 which has only one column, but in the leaf block there are 2 columns... have a look - for example:
row#131[6416] flag: ------, lock: 0, len=13
col 0; len 3; (3): c2 02 21
col 1; len 6; (6): 01 80 41 6f 00 83

After that i have a look at the index INDEX_TEST_02, and there are 3 columns in the index leaf block dump... but the index has only 2 columns:
row#131[6284] flag: ------, lock: 0, len=14
col 0; len 3; (3): c2 02 21
col 1; NULL
col 2; len 6; (6): 01 80 41 6f 00 83

It was interesting that a NULL value was stored in the index, even if oracle says that NULL values are not indexed.
Oracles statement with NULL values is correct in case of the index INDEX_TEST_03, there was no NULL value indexed... even tgough i put in some value to column F1. Only the non NULL values of F1 were stored in the index.

My question to you:
Why is there one more column in the leaf block dump as in the index definition? Is there any plausible cause?

Thanks and Regards
Stefan
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 9 2007
Added on Jul 12 2007
9 comments
762 views