indexing on epoch_time for faster where queries

This commit is contained in:
simon 2021-07-07 19:17:26 +07:00
parent efc2a61520
commit 129caa06a4
1 changed files with 6 additions and 0 deletions

View File

@ -11,6 +11,9 @@ CREATE TABLE aqi (
aqi_category VARCHAR(40) NOT NULL aqi_category VARCHAR(40) NOT NULL
); );
-- index for epoch_time where queries
CREATE INDEX aqi_epochtime ON aqi (epoch_time DESC);
-- example aqi insert -- example aqi insert
INSERT INTO aqi ( INSERT INTO aqi (
epoch_time, epoch_time,
@ -41,6 +44,9 @@ CREATE TABLE weather (
weather_icon VARCHAR(3) NOT NULL weather_icon VARCHAR(3) NOT NULL
); );
-- index for epoch_time where queries
CREATE INDEX weather_epochtime ON weather (epoch_time DESC);
-- example weather insert -- example weather insert
INSERT INTO weather ( INSERT INTO weather (
epoch_time, epoch_time,