Index for nullable column

前端 未结 3 528
攒了一身酷
攒了一身酷 2020-12-15 22:52

I have an index on a nullable column and I want to select all it\'s values like this:

SELECT e.ename 
FROM   emp e;

In the explain plan I s

3条回答
  •  执念已碎
    2020-12-15 23:11

    By default, relational databases ignore NULL values (because the relational model says that NULL means "not present"). So, Index does not store NULL value, consequently if you have null condition in SQL statement, related index is ignored (by default).

    But you can suprass this problem, check THIS or THIS article.

提交回复
热议问题