KR editions 107 to 111
In the next edition we'll take a look at the index structure and how it helps access table data.
KR-108 (INDEX - II) Let's take a look at what exactly an index contains (remember that it is a separate object - it's not part of the table). Let's say we have a table containing telephone number, customer name and payment amount. Assume that we've created an index on the telephone number. The telephone number is a unique field (there's an advantage of choosing a unique field on an index- explained later).
Index scan and table scan:
What's the advantage of having an index on a unique column?
KR-109 (INDEX - III) Basically, an index is similar to a table (the only difference being that here we’ll have 2 columns – one for the key and the other for the record location/ record ID).
Can an index have just 1 level? Yes. An index (depending on size) could have a root page which will contain the key and record IDs.
KR-110 (INDEX - IV) Continuing with the index structure:
We saw how indexes are stored, but what about tables themselves?
In partitioned TS all the partitions will contain rows of a single table
KR-111 (INDEX - V) This is edition number NELSON (111)! A look at the mysterious optimizer (KR-5 reloaded)...
What is the optimizer in DB2?
Why is the optimizer a mystery? IBM has kept the working algorithm of the optimizer a secret. But there does exist some info about what it does backstage and how it works. An optimizer is cost-based. This means that the optimizer will try to minimize the cost. Basically, when we write an SQL there are bound to be many ways of accessing the data. The optimizer works out the cost for the different possibilities and chooses the path which it evaluates as being the least costly.
Go back to the main contents page
Copyright © 2020 Sethu Subramanian All rights reserved. Reach me via email at ssbell @ gmail.com