added pregenreated SQL queries for timeseries