英文:
What is the max IN query size we can pass to a query?
问题
我正在寻找可以传递给Teradata SELECT查询中的IN操作符的最大大小。
在ORACLE中,IN查询最多接受1000个值,但在Teradata中,它接受超过5000个值。
性能问题:
当我在Teradata SELECT IN查询中执行超过1000个值时,需要大约30秒。
示例查询;
从Test中选择field1,feld2,field3,其中ID在(1,... 1000)中:
如果我在WHERE子句中添加更多筛选条件,是否会改善性能
像
示例查询;
从Test中选择field1,feld2,field3,其中createdDate = 日期,而ID在(1,... 1000)中:
注意:这个表中有很多数据,比如过去5年的数据。
谢谢,
Panneer
英文:
I am looking for the max size that we can pass to a Teradata SELECT query with IN operator.
In ORACLE, it accepts upto 1000 values in the IN Query but in Teradata it accepting more than 5000 values.
Performance issue:
When I execute more than 1000 values in the Teradata SELECT IN query, it is taking around 30 seconds.
Sample query;
Select field1,feld2, field3 from Test where ID IN (1,...1000):
Will it improve the performance if I add more filters in the WHERE clause
Like
Sample query;
Select field1,feld2, field3 from Test where createdDate=some date AND ID IN (1,...1000):
Note: This table has lot of data like last 5 years of data.
Thanks,
Panneer
答案1
得分: 2
关于性能,在尝试添加额外筛选条件时会发生什么?
英文:
There is no limit to the number of values in an IN clause, only a limit on the overall size of the query.
Regarding performance, what happens when you try adding extra filters?
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论