From the course: Advanced SQL for Data Science: Time Series
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Indexing data set 1: Time and location index - SQL Tutorial
From the course: Advanced SQL for Data Science: Time Series
Indexing data set 1: Time and location index
- [Instructor] Now, let's work with indexes but this time instead of working just with location, let's use event time in our index and see if that helps improve things. First thing I want to do is come over here to the indexes under the location temp column and I want to click refresh, and let's see if we have any indexes. Okay, so there are no indexes there. So we're starting with an index-free schema here, or at least with respect to this table, and we're going to work with our basic SQL query that we've been working with, which is to select by location ID the average temperature. And that's from the time series schema table called location temp. Now, I want to select based on time so I'm going to have a where clause that references event time and I'm going to select other rows on a particular day. So I'll use the between operator and we'll pick the day of March 5th, 2019. And we'll go to the 6th. One convenient thing about working with dates with Postgres is it if a string is in a…
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
-
-
-
-
-
-
(Locked)
Example data set 1: Temperature by time and location2m 44s
-
(Locked)
Indexing data set 1: Time index only4m 50s
-
(Locked)
Indexing data set 1: Time and location index4m
-
(Locked)
Creating a partitioned table4m 34s
-
(Locked)
Querying a partitioned table2m 37s
-
(Locked)
Example data set 2: CPU utilization and application type1m 57s
-
(Locked)
Indexing data set 2: Time and type Indexing3m 5s
-
(Locked)
-
-
-