Presentation is loading. Please wait.

Presentation is loading. Please wait.

Indexes and Views Unit 7.

Similar presentations


Presentation on theme: "Indexes and Views Unit 7."— Presentation transcript:

1 Indexes and Views Unit 7

2 Key Concepts Index structure Clustered vs. non-clustered indexes
Query optimization Creating indexes Selecting index columns Index forms Creating views Using views Updating through views

3 Data Storage Introduction to SQL, Figure 20.1, pg. 580

4 Indexed Data Introduction to SQL, Figure 20.2, pg. 582

5 Indexes Based on one or more columns.
Stored as physical database items. When indexed table columns are updated, indexes must also be updated. Unique indexes are used to force uniqueness on index columns. Single-column index, each value must be unique Multiple-column index, the combined column value for each row must be unique

6 Clustered and Non-Clustered Indexes
Table is physically sorted in index order A table can have only one clustered index Non-clustered index Logically organizes data Does NOT change the data's physical storage A table can have multiple non-clustered indexes

7 CREATE INDEX Introduction to SQL, Example 20.7 and 20.9 on pg.591

8 Index Columns Commonly used as selection criteria High cardinality
Enforced uniqueness Foreign key constraints

9 Impact of Cardinality Introduction to SQL, Figure 20.4, pg. 599

10 Processing Speed Introduction to SQL, Figure 20.5, pg 600

11 Index Forms Multitable (join) index Selective index Hash index
Bitmap index

12 View Fundamentals Virtual representation of one or more tables.
Used like a table when retrieving data. Specify the columns available to users or applications. Hide secure columns from users or applications. Can include computed columns.

13 Creating Views Introduction to SQL, Examples 21.1 and 21.2, pg. 612

14 Update Restrictions SELECT statement cannot contain:
DISTINCT Aggregate functions GROUP BY HAVING ORDER BY Computed (virtual) columns cannot be updated.


Download ppt "Indexes and Views Unit 7."

Similar presentations


Ads by Google