Data Inverted/Bitmap Indexing Flashcards

1
Q

In querying data

A

All attributes in the predicate are not PKs or FKs - clearly they are secondary attribute

The simplest solution is to serial read table and apply contrived predicate on each row. Expensive if there’s a lot of data.

How can we use indexes to be more effective than a sequential scan.

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

Solutions to Indexes in queries

A

Split queries to 2 and merge for common -> success depends on selectiveness

Split queries by column and merge for common -> high selectiveness required.

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

Bitmap

A
  • If an access request is not restricted to one PK attribute, simple direct access methods fail.

Bitmaps are an example of secondary index file structure. Convert search keys to a bit sequence related to a record or attribute instance.

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

Secondary index file structure

A

Table for relating secondary key field values to a number of master file records that have value. Essential for queries on multiple attributes or sequence of joins.

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

Bitmaps Variety

A

Fully inverted or Partially inverted indexes

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

Fully inverted index

A

A file that inverts all the attributes of a data file into bitmap. Some implementations make data file online retention redundant.

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

Partially inverted index

A

File structure that inverts only a subset of the data file attributes

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

Building a bitmap

A

Every value in a record’s attribute is represented as a key and the supplementary value in the index is a list of record pointers that hold that value.

  • Build by converting search keys into a boolean flag
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Bitmap Characteristics

A
  • Compact
  • Highly sparse
  • Accept no unique value
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Pattern Matching with Bitmaps

A

efficient. Once read, a bitmap page is unpadded and querying offers huge gains. Inadequate if attribute to invert has many distinct values. Expect rows to have little changes in reference-look-up values

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

Bitmap entries in covered indexes

A

Index Range Scan of an IOT: Oracle reads root node of index 1 and block in each branch 2+3 to find starting point of the range scan.

As row data is in IOT oracle needs to scan only leaf blocks 4,5,6 until all rows in range have been found.

More leaf blocks than normal index but less block reads overall.

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

IOT meaning

A

index-organised-tables

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

Queries that can be addressed by bitmaps include

A
  • AND as intersection
  • OR as Union
  • NOT as compliment
  • Minus (A and not B)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How to get result bitmap

A

Each op takes 2 bitmaps of same size and applies the operation on corresponding bits

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

Bitmap enhancements

A

Compression is possible (on strings of zero) to counter sparsity. Requires decompress on unpadding into RAM, and needs to be compressed before writing to disk.

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

Bitmap Slips

A

A simple numeric exercise to show how the size of bitmaps (compared to Btrees) deteriorates with the number of distinct values in an attribute to invert

Map number of distinct keys against size of either index.

17
Q

Other file structures that support secondary index demands include:

A
  • Bit pattern indexes
  • A collection of B Trees based on sub strings of concatenated key strings
  • Advanced data structures like grid files and R-Trees
18
Q

Factors of choosing other file structures:

A
  • Speed/Access requirements
  • Volumetric of master file
  • Secondary key field size
  • Secondary Key field data distribution
  • Resilience requirement