Re: Help calculating extents from esql-c
Posted in 1995
This thread's original question was "how do I determine the number
of extents assigned to a table?" If you are on the more recent
versions of OnLine, one answer is to use the sysextents table
in the sysmaster database. For example, you could use the command:
SELECT count(*)
FROM sysextents
WHERE tabname = "your table name";
However, while this might point out performance problems, it isn't
of much real use. Knowing the number of extents tells you nothing
about the table's size. As Neil pointed out earlier, if two extents
are contiguous, then they are merged into a single extent. A table
with one extent may be huge or tiny, it's not easy to tell.
It seemed to me that what the original author was after was a
way to compress extents. I suggested using the "alter index to cluster"
trick. Neil was correct in pointing out that this not guarenteed
to compress your table. If there is other activity going on or your
space is badly fragmented, then the alter won't be able to create
a single large extent. I believe, though, that this may also be
a problem when you create a table from scratch. If you specify a
large initial extent size and it's not available, then OnLine will
quietly give you only what's available. I don't know this for a
fact but it is how additional extents are allocated.
Finally, the "next extent" size is doubled after every 16 extents.
--Craig (craig@chemistry.utah.edu)