Physical Database Design

Materialized Views

CREATE VIEW <name> [AS] (<query>)
MATERIALIZED [AS <data_structure>]

Example: PNUM/(pnum, lname, dept)

  1. Btree primary index on pnum called PROF-PRIMARY
create view PROF-PRIMARY as (select * from PROF)
materialized as BTREE with search key (pnum)
  1. Btree secondary index lname called PROF-SECONDARY
create view PROF-SECONDARY
as (select lname, rid from PROF-PRIMARY)
materialized as BTREE with search key (lname)

Data Structure

<data_structure>

Workloads exist and are common that favour any of these

  • Navigational applications and R trees
  • OLAP workloads, main memory arrays, and heap files

Records encoding tuples in an index can also be co-clustered with records encoding tuples for another index

Co-Clustering Indices

Beyond Standard Physical Design

Query Optimizations

see also Query Optimization for Relational Algebra

View Based Query Rewriting Problem

Given a query Q and a physical database design consisting of a set of arbitrary materialized views {V1,Vn}, find the most efficient query plan P equivalent to Q that uses only views Vi

Theorem: View based query rewriting is undecidable

Query Plan Tools

Tool to enable one to investigate what plan is chose for a query and what the estimated cost is

select name from author, wrote where aid = author

Pasted image 20231214111938.png

Index Advising Tools

Tool to advise on a standard physical design given a workload description

Pasted image 20231214112025.png

Guidelines