Using an index to answer queries
Prelude: database definition
Database
of
movies
:
Movie
( title, year, length, genre, studioName. producer)
Suppose, we have:
A
secondary index
on
studioName
A
secondary index
on
year
Use index to answer queries
Sample query:
Find
movies
made by
Disney (Dis)
in the year
2005
Process
query as follows:
Find
all pointer
to
records
satisfying
studionName = Dis
:
Find
all pointer
to
records
satisfying
year = 2005
:
Compute
the
intersection
: