2. Table of Contents
DURATION Concept
DURATION Basic
DURATION BEFORE
DURATION FROM/TO
DURATION AFTER
1
2
3
4
5
DURATION Demo6
3. DURATION Concept
3
RDBMS
• Simplicity comparison of SQL query to search data for the last 10 minutes starting from the current time.
DURATION is the keyword that allows to specify the time range in the SELECT statement easily.
Improve SELECT performance significantly by narrowing down the physical access scope.
DURATION is based on internal hidden column, “_arrival_time”, which is automatically created.
데이터의 실시간 저장DURATION Time_Expression [ BEFORE|AFTER Time_Expression | TO_DATE(TIME)];
Time_Expression : all | year | month | day | hour | minute | second
SELECT * FROM t1 WHERE start_time > TO_DATE(‘2015-08-
01 20:50:00’, ‘YYYY-MM-DD HH24:MI:SS’);
InfiniFlux
SELECT * FROM t1 DURATION 10 minute;
4. DURATION Basic
4
Past
10 minute data
Scan direction
Now(Now – 10 minutes)
: Search and output data for the last 10 minutes of the current time in reverse order.
Search data within a specified time period based on the current time in reverse order.
SELECT * FROM t1 DURATION 10 minute;
5. DURATION BEFORE
5
Past Now(now – 1 hour)(now – 1 hour – 10 minute)
Scan direction
Past Now2015-05-12 15:00:002015-05-12 14:50:00
Scan direction
: Search and output data for the 10 minutes, 1 hour before the current time in reverse order.
: Search and output data for the 10 minutes before 15:00 on May 12, 2015 in reverse order.
BEFORE searches and outputs data starting from the current to the past time in reverse order, and also
is used for specifying relative or absolute starting point.
SELECT * FROM t1 DURATION 10 minute BEFORE 1 hour;
10 minute data 1 hour
SELECT * FROM t1 DURATION 10 minute BEFORE TO_DATE(‘2015-05-12 15:00:00’, ‘YYYY-MM-DD HH24:MI:SS’);
10 minute data Time gap
6. DURATION AFTER
6
Past Now2015-05-12 15:00:00
Scan direction
Past Now2015-05-12 15:10:002015-05-12 15:00:00
Scan direction
: Search and output all the data from 15:00 on May 12, 2015 to the current time.
AFTER searches and outputs data from the past to the current time.
: Search and output data for the 10 minutes after 15:00 on May 12, 2015.
SELECT * FROM t1 DURATION 10 minute AFTER TO_DATE(‘2015-05-12 15:00:00’, ’YYYY-MM-DD HH24:MI:SS’);
10 minute data Time gap
SELECT * FROM t1 DURATION ALL AFTER TO_DATE(‘2015-05-12 15:00:00’, ‘YYYY-MM-DD HH24:MI:SS’);
10 minute data
Output all the input data from the past to the current time;
SELECT * FROM t1 DURATION ALL AFTER TO_DATE(‘1970-01-01 09:00:00’, ‘YYYY-MM-DD HH24:MI:SS’);
7. DURATION FROM/TO
7
Past Now
Scan direction
Past Now2015-05-12 00:00:002015-05-10 00:00:00
Scan direction
: Search and output data for the two days from May 12, 2015 to May 10, 2015 in reverse order.
: Search and output data for the two days from May 10, 2015 to May 12, 2015 in sequential order.
2015-05-12 00:00:002015-05-10 00:00:00
FROM/TO search and output data based on the scope between the two specified times.
The direction of scan will be changed depend on the time value of the specified times as shown below.
SELECT * FROM t1 DURATION FROM TO_DATE(‘2015-05-12’, ‘YYYY-MM-DD’) TO TO_DATE(‘2015-05-10’, ‘YYYY-MM-DD’);
2 day data Time gap
SELECT * FROM t1 DURATION FROM TO_DATE(‘2015-05-10’, ‘YYYY-MM-DD’) TO TO_DATE(‘2015-05-12’, ‘YYYY-MM-DD’);
2 day data Time gap
8. The World's Fastest
Time Series DBMS
for IoT and Big Data
www.infiniflux.com
info@infiniflux.com
InfiniFlux