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

Querying a partitioned table - SQL Tutorial

From the course: Advanced SQL for Data Science: Time Series

Start my 1-month free trial

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…

Contents