ORGANIZATION FUNDAMENTALS. SPACE MAPS
This article deals with basics of Data Organization. I have
written this to try and explain some aspects of physical data storage
that I as a beginner had trouble understanding.
In this write up I will be dealing with Space map pages.
A space map page is no different than any other data page except for
the fact that it contains information about the data pages instead of
the data that belongs to the table(s) in the table space.
Imagine a huge restaurant with a lot of tables with 4 chairs around
each table. Also imagine Mr.Chang sitting at the reception of this
large restaurant with an A4 size sheet of paper. Let us call this paper
"map sheet". In this "map sheet" he records which tables are occupied
and which tables have seating available. When you and three of your
friends walk into the restaurant you don't randomly search for
vacant tables by yourself. You approach Mr.Chang at the reception and
tell him that you need a table for four. He looks at his "map sheet"
and directs you to the appropriate table and also updates his
Space map page serves the same function as the sheet of paper Mr.Chang
To put it very simply, every space map page holds information about a
group of pages. The number of pages in that group is called "the Range
of the space map page".
The information held in the space map page can be categorized into two
(a) Information about how much space is available in each page in
(b) Information about which pages in it's range have changed
since the last image copy. ( we will not discuss this information for
A typical table space will have more than one space map page
representing a fixed number of data pages within it's range as
shown in the picture below.
Why is it that we need multiple space map pages in one table space?
Remember that Mr.Chang has only ONE "map sheet" in his hand. He can
write down seating availability information about only a fixed number
of tables ( say 100 tables) in one "map sheet", after which
he simply runs out of space to write on that sheet of paper. If
he wishes to maintain information about more tables (say 143
tables) he simply has to use an other "map sheet". If he wishes
to maintain information about all the tables in his restaurant (say 231
tables) he has to use 3 "map sheets".
Similarly the number of space map pages in a table space depends
on the number of pages in the table space. The more the number of pages in the table
space, more the number of space map pages needed to keep track
of those pages.
What if we gave Mr.Chang an A2 sized sheet instead of an A4 sized
sheet? A2 is obviously a larger sheet of paper in which Mr.Chang
can record more information as compared to A4. May be he can even
record information regarding all the 231 tables in his restaurant in
just two A2 sheets.
Similarly as the page size of a table
space increases (from 4K to 8K to 16K etc.) the number of space map pages needed
for a given table space size reduces.
On the other hand, what if Mr.Chang decided to record more detailed
information about each table such as how many chairs are empty in each
table, is the empty space at each table enough to seat an average sized
dinner party etc? Obviously he would run out of space in the "map
sheet" much sooner than 100 tables worth of information because he has
to write down more information about each table.
Similarly the level of information
stored in the spacemap page also determines how many space map pages
will be used in a table space.
The aim of this article is to give a basic understanding of what
information is stored in a space map page and what are the factors that
affect the range of a space map page.
I will deal with the differences between Segmented , Simple and
Partitioned Space map pages in my next article and Space search
algorithms, OFFPOS and INDREF concepts in the last article.