DBMS - File Indexing Flashcards

1
Q

Index Structure

A

Data Structure and associated set of operations whose goal is the effective retrieval of data based on a criterion matched to part of the data file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Example of index Structures

A

BTree, Extensible Hashing, Bit mapped

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Example of search key

A

Empno, deptno, sal

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Indexed key

A

not necessarily the primary key set or the foreign key

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Index File

A

The reordering of part of a data file’s record to facilitate certain retrieval patterns.

Composed of many pairs of search key values and data file record pointers to the respective record with that matching value in the data file.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Index building and maintenance activities

A

needed to maintain its currency

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Index retrieval

A

usually meant to return an address in the data file where key matches criteria

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Index range scan

A

Oracle reads root node of index and block in each branch level. Leaf blocks scanned until the end of the range is encountered.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Two index modality of interest

A

Indices with ordered search keys, indices with search keys hashed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Clustered Index

A

Index with its search key specified on the ordering field of a sequential file of records.

Search key could be PK, if it is we have an index-sequential file.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Non-Clustered Index

A

An index on the ordering field of an ordered file of records.

Can either have primary or clustering type index but not both.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Secondary Index

A

Can be specified on any non ordering field of a data file. Doesn’t interfere with primary or clustered indexes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Index Density

A

The ratio of search keys to records in the data. If >=1 it is dense.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Multilevel indexing

A

Indexes of indexes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Why Indexing?

A
  • Max access speeds
  • Min access costs
  • sequential traversal of data
  • constraints for query, semantic and security
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Index Computational Costs

A
  • Time
  • Space
  • Resilience
  • Concurrency Support
17
Q

Index Issues

A
  • Each index structure comes with a respective set of retrieval operators
  • Excessive use of indexes deteriorates and floods disk IO bandwidth
  • Concurrency Control Issues
  • Indexes created and maintained but never used
  • Index use vs Sequential Scan
18
Q

Pin the address to an actual memory/file location

A

as late as possible

19
Q

Covering Indexes

A

When index entry contains the data record too

20
Q

Delete in a PK index

A

Search key in index, get record in data file, delete and reorganize data file

21
Q

Delete in a data file with a primary index

A

Get record in data file, search key in each primary index, delete index entry and reorganize each primary index

22
Q

Delete in a non-clustered index (By search index entry)

A

Get record in data file, get index entry.
IF data file has 1 search key instance, delete data file+index entry+ reorganize both
ELSE delete data file record and reorganize data file

23
Q

Delete in a non-clustered index (By RRN entry)

A

Search key in index, get first record in data file, DO delete and reorganize data file, WHILE next RRN has same key. Delete index entry and reorganize

24
Q

Sorting Datafiles Requirement

A
  • If data fits into main memory use Quicksort
  • If it doesnt fit into main memory use external merge sort
  • Can use indexes to help sort
25
Q

Sorting Requirements

A

ORDER BY or SELECT DISTINCT

In data cursors that is processing some subset of a table in main memory, one can sort it or leave it unordered.