【发布时间】:2017-02-04 12:59:00
【问题描述】:
我的任务是从表中获取某些员工在特定年份的数据,但查询大约需要。 50 分钟获取 50 000 条 emp 记录。
表大约有。 60亿(6*10^9)数据
查询:
select a, b
from t1
where t1.year in (2012,2013) and
t1.name in (select name from name_tab fetch first 50000 rows only)
Partitioned table: t1
partitioned col: t1.year
Index col: t1.name
我检查了访问计划,惊讶地发现分区和索引都没有被使用。
【问题讨论】:
-
是否愿意发布计划(来自
db2exfmt)以及实际的表和索引 DDL?
标签: sql indexing db2 partitioning