From the course: Advanced SQL for Data Scientists
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Generating data with generate_sequence
From the course: Advanced SQL for Data Scientists
Generating data with generate_sequence
- [Instructor] Okay, before we get into using explained plan let's create some data for us to work with. Now, the first thing I want to do is just paste in some code that we have seen already earlier. Basically what I want to do is recreate an IOT sensor measurement table, and create a couple of partitions. I won't go over all the details 'cause I've covered this in an earlier video but I do want to point out a couple of things. In this case, we're going to use measurement date. We're actually going to make that a timestamp so we can include hours and minutes as well. And I just want to point out in terms of creating partitions we want to keep in mind that this last value that at the end of the range is not inclusive. I always forget this. So for example, if I set this date to be 2021 01-31, that's a perfectly valid range to go from January 1st to January 31st, but it's not inclusive. I always forget that. So I just want…
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
-
-
-
-
-
EXPLAIN and ANALYZE commands7m 41s
-
(Locked)
Generating data with generate_sequence4m 16s
-
(Locked)
Generating time series data6m 35s
-
(Locked)
Analyzing a query with WHERE clauses and indexes2m 46s
-
(Locked)
Analyzing a query with a join5m 57s
-
(Locked)
Challenge: Optimize a query using an explain plan33s
-
(Locked)
Solution: Optimize a query using an explain plan1m 39s
-
-
-
-