简体   繁体   English

优化器拒绝使用索引

[英]optimizer refuses to use the index

SELECT /*+ PARALLEL(cfe, 6) */
      dpd.f_p_descr,
      ef.t_a_code,
      pd.p_name,
      ef.t_q
 FROM e_fact ef
INNER JOIN d_dim dd
   ON ef.t_d_key = dd.d_key
INNER JOIN f_e cfe
   ON ef.ref_id = cfe.t_id
  AND ef.r_version = cfe.t_version
INNER JOIN d_dim dpd
   ON dpd.d_key = ef.d_key
INNER JOIN p_dim pd
   ON pd.p_key = ef.b_p_key
INNER JOIN r_dim rd
   ON rd.r_key = ef.t_r_key
INNER JOIN f_t_dim ftd
   ON ftd.t_key = cfe.t_key
WHERE dd.d_value = '19-OCT-2012'
  AND dpd.f_d = 'XYZ'
  AND ftd.s_id IN (201, 209)
  AND rd.r_n = 'ABC'

I got this query from production, problem is optimizer refuses to use the index on f_e even when the hint is added ( /*+ index(e.c_fact_idx12) */ . What should be my approach and what all things I need to check for this. Is there any other way to tune this query? New to query tuning so help would be appreciated.我从生产中得到了这个查询,问题是即使添加了提示,优化器也拒绝使用f_e上的索引( /*+ index(e.c_fact_idx12) */ 。我的方法应该是什么以及我需要检查的所有内容这个。有没有其他方法来调整这个查询?查询调整的新手,所以帮助将不胜感激。

您正在使用e.c_fact_idx12 ,但表别名e未在查询中的任何位置定义!

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

相关问题 为什么优化器在联接时不使用索引查找 - Why Optimizer Does Not Use Index Seek on Join 为什么MySQL优化器不使用所有列索引? - Why MySQL optimizer doesn't use all columns index? Oracle Optimizer尴尬地不喜欢使用索引 - Oracle Optimizer Awkwardly Doesn't Prefer to Use Index 如何告诉MySQL Optimizer在派生表上使用索引? - How do I tell the MySQL Optimizer to use the index on a derived table? 优化器未使用索引 - Index is not being used by optimizer JOINING 时如何让 MySQL 优化器首先使用我的索引? - How can I get MySQL optimizer to use my index first when JOINING? 为什么 PostgreSQL 11 优化器拒绝使用包含列的索引的最佳计划? - Why is PostgreSQL 11 optimizer refusing best plan which would use an index w/ included column? 每次创建索引以便Oracle优化器使用它时,是否需要运行gather_table_stats? - Do I need to run gather_table_stats every time I create an index in order for the Oracle optimizer to use it? 优化程序将忽略唯一筛选索引和索引视图 - Unique filtered index and indexed view are ignored by optimizer 用于简单选择查询的 MySQL 优化器索引选择 - MySQL optimizer index choice for simple select query
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM