0

有没有优化taos sql的经验。我处于以下情况。我从历史跟踪日志中查询了一天的跟踪信息。10天内从1亿行中查询了近1000万行。我花了40分钟。我的sql如下:

select busi_dt,tx_dt,bill_no,prd_no.......,occur_date from trace_log where occur_date='2021-08-02;'

列[busi_dt] 是时间戳,[occur_date] 是二进制(8);我知道如果我可以使用第一列 [busi_dt],由于索引,速度可以非常快。但是我的情况在这里是不允许的,[busi_dt] 和[occur_date] 没有固定关系。那么我该怎么做才能优化我的 sql 执行速度。

4

1 回答 1

0

我认为使用'select ... where ... from begin_time to end_time'可以利用时间序列数据库的优势来快速定位硬盘中的数据文件。值得尝试。

于 2021-08-03T10:47:00.787 回答