繁体   English   中英

redshift sql current_date get_date()性能问题

[英]redshift sql current_date get_date() performance issue

我想知道,与直接使用“2016-05-05”相比,在get_date() SQL上使用current_dateget_date()函数是否会降低查询性能。

例1:

select * from table a where time> = current_date - 1和time <current_date

例2:

select * from table a where time> ='2016-05-08'and time <'2016-05-09'

示例1或示例2会有更好的表现吗? 或者两者都一样?

希望有人可以对此有所了解

我刚碰到这个,所以我将分享我的轶事经验:

select * from table where ts > current_date limit 20运行10 +分钟然后我不耐烦并将其杀死。

select * from table where ts > '2017-06-08' limit 20在16s完成。

table在ts上有一个排序键,并进行了新的分析

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM