Bitmap Indexes.

Slides:



Advertisements
Similar presentations
Physical Database Design and Tuning R&G - Chapter 20 Although the whole of this life were said to be nothing but a dream and the physical world nothing.
Advertisements

Organisation Of Data (1) Database Theory
Bitmap Index Design and Evaluation Ariel Noy Data representation and retrieval seminar By: Chee-Yong Chan Yannis E.Ioannidis.
CMU SCS : Multimedia Databases and Data Mining Lecture#5: Multi-key and Spatial Access Methods - II C. Faloutsos.
CSE544 Database Statistics Tuesday, February 15 th, 2011 Dan Suciu , Winter
Matrix Completion IT530 Lecture Notes. Matrix Completion in Practice: Scenario 1 Consider a survey of M people where each is asked Q questions. It may.
Multidimensional Indexing
Chapter 11 Indexing and Hashing (2) Yonsei University 2 nd Semester, 2013 Sanghyun Park.
Multidimensional Data. Many applications of databases are "geographic" = 2­dimensional data. Others involve large numbers of dimensions. Example: data.
Multidimensional Data Rtrees Bitmap indexes. R-Trees For “regions” (typically rectangles) but can represent points. Supports NN, “where­am­I” queries.
Multidimensional Data
Multidimensional Data. Many applications of databases are "geographic" = 2­dimensional data. Others involve large numbers of dimensions. Example: data.
Relational Algebra.
Indexes. Primary Indexes Dense Indexes Pointer to every record of a sequential file, (ordered by search key). Can make sense because records may be much.
Indexes. Primary Indexes Dense Indexes Pointer to every record of a sequential file, (ordered by search key). Can make sense because records may be much.
COMP 451/651 Indexes Chapter 1.
COMP 451/651 B-Trees Size and Lookup Chapter 1.
Indexes. An index on an attribute A of a relation is a data structure that makes it efficient to find those tuples that have a fixed value for attribute.
Bitmap Index Buddhika Madduma 22/03/2010 Web and Document Databases - ACS-7102.
BTrees & Bitmap Indexes
Multiple-key indexes Index on one attribute provides pointer to an index on the other. If V is a value of the first attribute, then the index we reach.
Indexes. Primary Indexes Dense Indexes Pointer to every record of a sequential file, (ordered by search key). Can make sense because records may be much.
CSCI 5708: Query Processing I Pusheng Zhang University of Minnesota Feb 3, 2004.
ACS-4902 Ron McFadyen Chapter 15 Algorithms for Query Processing and Optimization.
Quick Review of Apr 15 material Overflow –definition, why it happens –solutions: chaining, double hashing Hash file performance –loading factor –search.
COMP 451/651 Multiple-key indexes
Primary Indexes Dense Indexes
BITMAP INDEXES Parin Shah (Id :- 207). Introduction A bitmap index is a special kind of index that stores the bulk of its data as bit arrays (commonly.
CSCI 5708: Query Processing I Pusheng Zhang University of Minnesota Feb 3, 2004.
Optimization Exercises. Question 1 How do you think the following query should be computed? What indexes would you suggest to use? SELECT E.ename, D.mgr.
Multidimensional Data Many applications of databases are ``geographic'' = 2­dimensional data. Others involve large numbers of dimensions. Example: data.
SQL By: Toan Nguyen. Download Download the software at During the installation –Skip sign up for fast installation.
1 Chapter 12: Indexing and Hashing Indexing Indexing Basic Concepts Basic Concepts Ordered Indices Ordered Indices B+-Tree Index Files B+-Tree Index Files.
100 Addition Facts DIRECTIONS:  Watch the screen.  Say the answer to each addition fact when it appears.  You have 3 seconds to say each answer.
Chapter 13 Query Processing Melissa Jamili CS 157B November 11, 2004.
Bitmap Indices for Data Warehouse Jianlin Feng School of Software SUN YAT-SEN UNIVERSITY.
Physical Database Design I, Ch. Eick 1 Physical Database Design I About 25% of Chapter 20 Simple queries:= no joins, no complex aggregate functions Focus.
Introduction to Data Manipulation in SQL CIS 4301 Lecture Notes Lecture /03/2006.
Introduction to Indexes. Indexes An index on an attribute A of a relation is a data structure that makes it efficient to find those tuples that have a.
Packet Classification using Tuple Space Search
What have we learned?. What is a database? An organized collection of related data.
C-Store: Data Model and Data Organization Jianlin Feng School of Software SUN YAT-SEN UNIVERSITY May 17, 2010.
ITEC 2620M Introduction to Data Structures Instructor: Prof. Z. Yang Course Website: ec2620m.htm Office: Tel 3049.
Sec 14.7 Bitmap Indexes Shabana Kazi. Introduction A bitmap index is a special kind of index that stores the bulk of its data as bit arrays (commonly.
Index Tuning Conventional index Secondary index To speed up queries on attributes not within primary key Primary index –Determine.
BITMAP INDEXES Sai Priya Rama Gopal SJSU ID : Class ID: 125.
Indexes. Primary Indexes Dense Indexes Pointer to every record of a sequential file, (ordered by search key). Can make sense because records may be much.
Chapter 5 Multidimensional Indexes. One dimensional index can be used to support multidimensional query. F1=‘abcd’ F2= 123‘abcd#123’
G042 - Lecture 12 Using Local Databases Mr C Johnston ICT Teacher
Ranking Instructor: Gautam Das Class notes Prepared by Sushanth Sivaram Vallath.
603 Database Systems Senior Lecturer: Laurie Webster II, M.S.S.E.,M.S.E.E., M.S.BME, Ph.D., P.E. Lecture 11 A First Course in Database Systems.
603 Database Systems Senior Lecturer: Laurie Webster II, M.S.S.E.,M.S.E.E., M.S.BME, Ph.D., P.E. Lecture 18 A First Course in Database Systems.
Practical Questions Movie (Title, Year, Length, inColor, StudioName, Producer) Give the SQL Statement that produced the outcome for the following query.
Secondary Indexes Secondary Indexes By Jignesh Borisa(111) By Jignesh Borisa(111)
จัดทำโดย นายชนากานต์ สันติคุณาภรณ์ นายธฤษพงศ์ ศิริบูรณ์ นางสาวศุภาภรณ์ ถ่านคำ.
Approximation by Constraints Why do we need approximation/interpolation? –Record values at some finite set of points in space and time. –Does not capture.
CS315 Introduction to Information Retrieval Boolean Search 1.
Multidimensional Access Structures COMP3017 Advanced Databases Dr Nicholas Gibbins –
Partitioned Sorting of Bitmap Indices Kyle Brooks.
BITMAP INDEXES Barot Rushin (Id :- 108).
Chapter 5. Multidimensional Indexes
Indexing Goals: Store large files Support multiple search keys
Parallel Databases.
Multidimensional Access Structures
COMS E F15 Lecture 2: Median trick + Chernoff, Distinct Count, Impossibility Results Left to the title, a presenter can insert his/her own image.
Lecture 15: Bitmap Indexes
100 Addition Facts DIRECTIONS: Watch the screen.
Chapter 11: Indexing and Hashing
MIS 451 Building Business Intelligence Systems
VECTOR SPACE MODEL Its Applications and implementations
Presentation transcript:

Bitmap Indexes

Definition A collection of bit-vectors of length n n means the total number of records Each bit of this vector stands for one possible values that may appear in this field. At position i for the vector of value v, if the i th record have value v , then the value of vector bit i is “1”. otherwise “0”

Example 1. How the bitmap index forms Sample Relation R(F,G) F G 30 foo bar 40 baz 50 Tuple # 1 Tuple # 2 Tuple # 3 Tuple # 4 Tuple # 5 Tuple # 6

Example 1. How the bitmap index forms (continue..) Let’s see field “F” How many DISTINCT values ? 3; they are 30,40,50 so, the total number of tuples in the bitmap index is 3. How many records ? 6 so, the length of bit-vector is 6.

Example 1. How the bitmap index forms (continue..) Distinct value: 3 Total tuple : 6 Bitmap index: value Bit-vector 30 xxxxxx 40 50 Distinct values: Length of Bit-Vector is 6

Example 1. How the bitmap index forms (continue..) How to form bit-vector ? Let’s see Value 30 Which Tuples has the value 30 in field F? (1, 2, 6) value Bit-vector 30 xxxxxx 40 50

Example 1. How the bitmap index forms (continue..) So, the bit-vector of value 30 is : Tuple1 Tuple2 Tuple3 Tuple4 Tuple5 Tuple6 1

Example 1. How the bitmap index forms Fill the bit-map index of Field “F” as following: value Bit-vector 30 1 1 0 0 0 1 40 0 0 1 0 1 0 50 0 0 0 1 0 0

Example 1. How the granular index forms Fill the bit-map index of Field “F” as following: value Granular values Bit-vector 30 e1,e2,e6 1 1 0 0 0 1 40 e3,e5 0 0 1 0 1 0 50 e5 0 0 0 1 0 0

Example 1. The bitmap index is sorted on F Sample Relation R(F,G) F G 30 foo bar baz 40 50 Tuple # 1 Tuple # 2 Tuple # 6 Tuple # 4

Example 1. How the granular index forms value Granular values Bit-vector 30 e1,e2,e6 1 1 0 0 0 1 30(sorted 1 1 1 0 0 0 40 e3,e5 0 0 1 0 1 0 40 (sorted 0 0 0 1 1 0 50 e5 0 0 0 1 0 0 50 sorted 0 0 0 0 0 1

Do we need Bitmap-Index? Too much space ? Suppose Relation R(F,G) has n tuples, the total # of bits need for the bitmap index is n2 ! How to find the i th record in a bitmap index?

Advantage of Bitmap Index Accelerate the search. Example 2 Consider following Relation: Movie (title, year, length, studioName) We need to run the following query: SELECT title FROM Movie WHERE studioName = ‘Disney’ AND year = 1995;

Example 2. (contiue…) With following tuples: studioName year Disney 1995 MGM 1996 DreamFactory 2000

Example 2. (contiue…) Disney 1 0 0 0 0 1 MGM 0 1 0 1 0 0 DreamFactory Suppose we build Bitmap index in the field of “studioName” and “year” Bitmap Index on Field “studioName” Disney 1 0 0 0 0 1 MGM 0 1 0 1 0 0 DreamFactory 0 0 1 0 1 0 Bitmap Index on Field “studioName” 1995 1 0 0 1 0 0 1996 0 1 0 0 0 0 2000 0 0 1 0 0 1

Example 2. (contiue…) The query is : SELECT title FROM Movie WHERE studioName = ‘Disney’ AND year = 1995; So we INTERSECT the bitmap index with value of ‘Disney” and ‘1995’ 1 0 0 0 0 1 AND 1 0 0 1 0 0 1 0 0 0 0 0 Answer: tuple #1

Example 3 Bitmap index also accelerate range query. Age salary 25 60 Consider following Relation R( age, salary) Age salary 25 60 22 55 30 70 23 100 45

Example 3 (continue…) We have following bitmap index: 22 Field “AGE” 22 0 1 0 1 0 0 0 0 23 0 0 0 0 1 0 1 0 25 1 0 0 0 0 1 0 0 30 0 0 1 0 0 0 0 1 Field “salary” 45 0 0 0 0 0 0 1 1 60 1 0 0 0 0 0 0 0 55 0 1 0 1 1 0 0 0 70 0 0 1 0 0 0 0 0 100 0 0 0 0 0 1 0 0

Example 3 (continue…) Consider the following Query: SELECT * FROM R WHERE 23 <= age <= 25 and 60 <= salary <= 70

Example 3 (continue…) First , find bitmap index of field “AGE” satisfy the requirement, do “OR” Operation: 23 0 0 0 0 1 0 1 0 25 OR 1 0 0 0 0 1 0 0 1 0 0 0 1 1 1 0 Second, find bitmap index of field “Salary” satisfy the requirement, do “OR” operation 60 1 0 0 0 0 0 0 0 55 0 1 0 1 1 0 0 0 OR 0 0 1 0 0 0 0 0 1 1 1 1 1 0 0 0

Example 3 (continue…) Then , do INTERSECT of the 2 vector: 1 0 0 0 1 1 1 0 AND 1 1 1 1 1 0 0 0 1 0 0 0 1 0 0 0 So, the answer to this query is tuple #1 and tuple #5

How to compress bitmap index? Several algorithms available.