From the course: Advanced SQL for Query Tuning and Performance Optimization
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Bitmap index example plan - SQL Tutorial
From the course: Advanced SQL for Query Tuning and Performance Optimization
Bitmap index example plan
- [Instructor] Let's see an example where Postgres creates bitmap indexes on the fly. We'll work with the staff table again. This time, let's take a look at job title. And first thing I'm going to do is let's list all the distinct job titles. So, I will select DISTINCT job_title from staff, and let's also order by job_title. Take advantage of our popups here. And, let's see, select DISTINCT job_title. Give that a run. And what we'll see here, there are 186 distinct job titles. So, let's take a look at some of these. Let's pick one, in particular. How about, let's see, oh, operator. Let's go, and now, let's run a different select statement. Let's select star from staff, where job_title is equal to operator. And let's just run that, and we'll see we get a list of 11 rows. Now, let's see how that was executed. So, let's put an explain. Let's have, for an explanation here, and we'll run that.…
Contents
-
-
-
-
-
Indexing3m 16s
-
(Locked)
B-tree indexes2m 21s
-
(Locked)
B-tree index example plan4m 44s
-
(Locked)
Bitmap indexes1m 40s
-
(Locked)
Bitmap index example plan3m 6s
-
(Locked)
Hash indexes1m 19s
-
(Locked)
Hash index example plan2m 53s
-
(Locked)
Bloom filter indexes6m 32s
-
(Locked)
PostgreSQL-specific indexes1m 54s
-
(Locked)
Challenge: Choosing an index31s
-
(Locked)
Solution: Choosing an index37s
-
-
-
-
-
-
-