Oracle extents – How to have so few with this large size

oracleoracle-11g-r2storage

Note on duplication:

This is not a duplicate of "Oracle extents – How can I have so many with this small size?" This is a separate question I entered which happens to be in the same domain.

This is a duplicate of "Oracle extents – how is it possible to get so many? [closed]" – this is a question that was closed because someone thought it was a duplicate of the above question, apparently without reading either question, and despite the fact that neither question had an answer. I see why this Stackexchange is not exactly flourishing.

Question:

This is more curiosity about how Oracle Database works than anything I need to change (yes I know multiple extents are fine, I read Tom Kyte too).

I have an index with the following characteristics:

Size:        376MB
Initial Ext: 118MB
Next Ext:    1MB
Num Extents: 12

In case it's not apparent, my question is, how can I have something that size, with those extents sizes, and only 12 extents? 376 > 118 + (1 * 11)

FYI: to Justin Cave, yes, it's locally-managed.

Thank you.

Best Answer

You may believe that this is a different question but my answer is going to be essentially identical assuming the additional information from the prior question is the same-- you're using automatic extent allocation and you're not sure how Toad is determining these numbers.

The data you're getting from Toad appears to be incorrect or, at least, misleading. If you are using a locally managed tablespace with automatic extent allocation, Oracle will determine your initial and next extent sizes automatically. In 11.2, the first 16 extents are going to be 64k in size (for a total of 1 MB). The next 63 extents are going to be 1 MB in size. So if you have 12 extents, that implies that the table occupies 768 kb of space on disk. An initial extent of 118 MB makes no sense and a size of 376 MB makes no sense.

What does

SELECT tablespace_name,
       extent_id, 
       bytes/1024 kb
  FROM user_extents
 WHERE segment_name = <<name of index>>

show you? If you have 12 extents, you should see that extents 0-11 are 64 kb in size.

SELECT SUM(bytes)/1024/1024 size_in_mb
  FROM user_extents
 WHERE segment_name = <<name of index>>

will show you the total size of the table's extents on disk.