Oracle 10g - optimize WHERE IS NOT NULL

后端 未结 9 1830
长情又很酷
长情又很酷 2020-12-13 20:56

We have Oracle 10g and we need to query 1 table (no joins) and filter out rows where 1 of the columns is null. When we do this - WHERE OurColumn IS NOT NULL - we get a full

9条回答
  •  离开以前
    2020-12-13 21:31

    See http://www.oracloid.com/2006/05/using-index-for-is-null/

    If your index is on one single field, it will NOT be used. Try to add a dummy field or a constant in the index:

    create index tind on t(field_to_index, 1); 
    

提交回复
热议问题