Download presentation
Presentation is loading. Please wait.
1
Database Management System
Lecture - 39 © Virtual University of Pakistan
2
© Virtual University of Pakistan
Index Classification Clustered vs. unclustered: If order of data records is the same as order of index data entries, then called clustered index. © Virtual University of Pakistan
3
© Virtual University of Pakistan
Index Classification A file can be clustered on at most one search key. Cost of retrieving data records through index varies greatly based on whether index is clustered or not! © Virtual University of Pakistan
4
Clustered vs. Unclustered Index
Index entries direct search for data entries Data entries Data entries (Index File) (Data file) Data Records Data Records © Virtual University of Pakistan
5
© Virtual University of Pakistan
When to Use Indexes Useful on large tables Required on PK Useful for attributes appearing in where, order by and group by clauses © Virtual University of Pakistan
6
© Virtual University of Pakistan
When to use Significant variety in values Check the limit of indexes with your DBMS Make your decision very much justifiable; indexes introduce overhead © Virtual University of Pakistan
7
© Virtual University of Pakistan
Indexes Summary Useful tool to speedup the data access Can be unique or non-unique Can be implemented through different techniques Be careful; they involve overhead © Virtual University of Pakistan
8
© Virtual University of Pakistan
Views © Virtual University of Pakistan
9
© Virtual University of Pakistan
Definition A view is defined to combine certain data from one or more tables for different reasons A view is like a window through which we can see data from one or more tables © Virtual University of Pakistan
10
© Virtual University of Pakistan
Why Views? Security Show the data to a users’ group that is necessary/required for them Give only necessary authorizations No concern with rest of the data © Virtual University of Pakistan
11
© Virtual University of Pakistan
Why Views? Efficiency Part of a query that is frequently used (a subquery), define it as a view The view definition will be stored and will be executed anytime anywhere view is referred © Virtual University of Pakistan
12
© Virtual University of Pakistan
Why Views? Join columns from multiple tables so that they look like a single table Aggregate information instead of supplying details © Virtual University of Pakistan
13
Characteristics of Views
Not exactly the external views of 3-level schema architecture Major Types Dynamic Materialized Partitioned Simple/complex © Virtual University of Pakistan
14
© Virtual University of Pakistan
Dynamic Views Data is not stored for the views Definition is stored in the schema Executed every time view is referred © Virtual University of Pakistan
15
Defining Dynamic Views
CREATE VIEW [ < database_name > . ] [ < owner > . ] view_name [ ( column [ ,...n ] ) ] [ WITH ENCRYPTION | SCHEMABINDING [ ,...n ] ] AS select_statement [ WITH CHECK OPTION ] © Virtual University of Pakistan
16
Database Management System
Lecture - 39 © Virtual University of Pakistan
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.