From the course: Advanced SQL for Query Tuning and Performance Optimization
Unlock the full course today
Join today to access over 24,400 courses taught by industry experts.
B-tree index example plan - SQL Tutorial
From the course: Advanced SQL for Query Tuning and Performance Optimization
B-tree index example plan
- [Instructor] Okay, now let's open our database tool, if it's not already available. Now, I'm going to navigate to the public schema where we've created our example tables. So I'm just going to go up to connections, double click on the Postgres database and drill down through schemas to public to tables. And I'll just show the tables we have. Now, the tables we're primarily interested in are the company_division, company_region and staff table. I'm just going to be working with the staff table in this video. So what I want to do is let's just start with something really simple. Let's do a SELECT count * from staff. So let's do a SELECT count * from staff. And I'm going to run that on the active connection. And that'll show me that we have a count of 1,000. So we have 1,000 rows in the table. Now let's see what the data actually looks like by changing this query to SELECT * from staff. And let's run that. And I'm just…
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
-
-
-
-
-
-
-