[1] Implementing Indexes Flashcards
What is a Page in TSQL?
A page is a 8 KB unit and belongs to a single object (e.g. table).
How many pages make an Extent?
8 (64KB).
What are the two types of extents and how do they differ?
- Mixed extent: when the underlying pages belong to multiple objects.
- Uniform extent: when the underlying pages belong to only one object.
How does SQL Server store pages in extents?
The first 8 in mixed extents and the subsequent in uniform extents.
What are the two other names for a Heap?
Balanced Tree and Clustered Table.
Is a Heap ordered in any way?
No.
What is an IAM and what purpose does it serve?
Index Allocation Mapping organises pages/extents with objects.
What is an IAM Page and what purpose does it serve?
An Index Allocation Mapping Page organises pages/extents with objects.
How many IAM can an object have?
At least one.
What is a Doubly Linked List and how does it work?
It is the structure SQL Server uses to organise large objects that have multiple IAM pages. Each page has a pointer to its decendent and antecendent.
How does SQL Server store data in a Heap?
SQL Server stores new rows anywhere in a heap: i.e. in an existing page if there is space, or a new page/extent.
What are the explicit and implicit ways a user can avoid data being stored in a Heap?
Explicit: creating a clustered index,
Implicit: primary key/ unique constraints.
What is the name given to the situation in which not all the pages in a heap are full?
Internal Fragmentation
How does Internal Fragmentation affect memory usage?
Because new rows are added to existing pages that are not full, SQL Server has less pages to read when retrieving information.
Is a Clustered Index the same as a Balanced Tree?
Yes. It begins with a single IAM and multiple pages thereafter.