TIMESERIES: Why it starts from '2013-02-16'?
--- script for test(see results) ------------------------------ \set min '''2013-02-26 00:00:00''' \set max '''2013-09-11 00:00:00''' \set interval '''14 DAYS 12 HOURS 47 MINUTES''' SELECT ts FROM (SELECT :min::TIMESTAMP as tm UNION SELECT :max::TIMESTAMP as tm) as t TIMESERIES ts as :interval OVER (ORDER BY tm);
--- results ------------------------------ ts --------------------- 2013-02-16 18:30:00 2013-03-03 07:17:00 2013-03-17 20:04:00 2013-04-01 08:51:00 2013-04-15 21:38:00 2013-04-30 10:25:00 2013-05-14 23:12:00 2013-05-29 11:59:00 2013-06-13 00:46:00 2013-06-27 13:33:00 2013-07-12 02:20:00 2013-07-26 15:07:00 2013-08-10 03:54:00 2013-08-24 16:41:00 2013-09-08 05:28:00 (15 rows)
Vertica version:
Vertica Analytic Database v6.1.2-0 Brief explanation: 1. UNION selects two dates 'min'&'max' as column
daniel=> \p SELECT '2013-02-26 00:00:00'::TIMESTAMP as tm UNION SELECT '2013-09-11 00:00:00'::TIMESTAMP as tm; daniel=> \g tm --------------------- 2013-09-11 00:00:00 2013-02-26 00:00:00 (2 rows)
2. TIMESERIES should fill with constant predefined interval (final query) --- By example from here:
https://my.vertica.com/docs/6.1.x/HTML/index.htm#14431.htm (Creating a dense time series)