[add describe for the timestamp of insert the oldest and earliest recode]

This commit is contained in:
lihui 2020-02-21 17:39:06 +08:00
parent ac67bf0ec7
commit 7cd2981e2e
2 changed files with 7 additions and 5 deletions

View File

@ -191,9 +191,10 @@ TDengine缺省的时间戳是毫秒精度但通过修改配置参数enableMic
```
同时向表tb1_name和tb2_name中按列分别插入多条记录
注意对同一张表插入的新记录的时间戳必须递增否则会跳过插入该条记录。如果时间戳为0系统将自动使用服务器当前时间作为该记录的时间戳。
注意1、对同一张表插入的新记录的时间戳必须递增否则会跳过插入该条记录。如果时间戳为0系统将自动使用服务器当前时间作为该记录的时间戳。
2、允许插入的最老记录的时间戳是相对于当前服务器时间减去配置的keep值数据保留的天数允许插入的最早记录的时间戳是相对于当前服务器时间加上配置的days值数据文件存储数据的时间跨度单位为天。keep和days都是可以在创建数据库时指定的缺省值分别是3650天和10天。
**IMPORT**如果需要将时间戳小于最后一条记录时间的记录写入到数据库中可使用IMPORT替代INSERT命令IMPORT的语法与INSERT完全一样。如果同时IMPORT多条记录需要保证一批记录是按时间戳排序好的。
**IMPORT**如果需要将时间戳小于最后一条记录时间的记录写入到数据库中可使用IMPORT替代INSERT命令IMPORT的语法与INSERT完全一样。
## 数据查询

View File

@ -181,9 +181,10 @@ All the keywords in a SQL statement are case-insensitive, but strings values are
tb2_name (tb2_field1_name, ...) VALUES(field1_value1, ...) (field1_value2, ...)
```
Note: For a table, the new record must have a timestamp bigger than the last data record, otherwise, it will be discarded and not inserted. If the timestamp is 0, the time stamp will be set to the system time on the server.
**IMPORT**: If you do want to insert a historical data record into a table, use IMPORT command instead of INSERT. IMPORT has the same syntax as INSERT. If you want to import a batch of historical records, the records must be ordered by the timestamp, otherwise, TDengine won't handle it in the right way.
Note: 1. For a table, the new record must have a timestamp bigger than the last data record, otherwise, it will be discarded and not inserted. If the timestamp is 0, the time stamp will be set to the system time on the server.
2.The timestamp of the oldest record allowed to be inserted is relative to the current server time, minus the configured keep value (the number of days the data is retained), and the timestamp of the earliest record allowed to be inserted is relative to the current server time, plus the configured days value (the time span in which the data file stores data, in days). Both keep and days can be specified when creating the database. The default values are 3650 days and 10 days, respectively.
**IMPORT**: If you do want to insert a historical data record into a table, use IMPORT command instead of INSERT. IMPORT has the same syntax as INSERT.
## Data Query