From the course: Advanced SQL for Data Science: Time Series
Unlock the full course today
Join today to access over 22,400 courses taught by industry experts or purchase this course individually.
Querying a partitioned table - SQL Tutorial
From the course: Advanced SQL for Data Science: Time Series
Querying a partitioned table
- [Instructor] Now that we've created a partition table, let's look at some EXPLAIN PLANS for querying that table. I'm going to open an exercise file, so I've navigated to chapter four and I'm going to open the file named 4.5 Query Partition Table.sql. And, this file contains three explained statements and I'm basically going to run them from here other than typing them all in again. And, so what I'll do, is I'm going to run the first one and you'll notice in this statement we're selecting location I.D and the average temperature from the location temp table. So, this is the original one, this is the non partitioned temp table and we're looking for about a days worth of data. So, when we execute that, we'll notice that we have the EXPLAIN PLAN, that we're probably familiar with now it's the parallel sequence scan followed by sorting and then the merging across two workers. And, the key number we want to look at here is the cost. And, it's a about 700, 7640 So, we'll just keep that…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
Example data set 1: Temperature by time and location2m 44s
-
Indexing data set 1: Time index only4m 50s
-
Indexing data set 1: Time and location index4m
-
Creating a partitioned table4m 34s
-
Querying a partitioned table2m 37s
-
Example data set 2: CPU utilization and application type1m 57s
-
Indexing data set 2: Time and type Indexing3m 5s
-
-
-
-