Query on null values of a date field
-
I am using a RAC database 10.2.0.4 and I have the next query:
SELECT * FROM JOSUE.CREDBURS_PAGOS CP WHERE CP.FECHA_PROCESO_PAGO IS NULL;
-
That one, takes 17 mins and performs a full table scan.
-
The field FECHA_PROCESO_PAGO is date type.
I have created the index "I_FECHA_PROCESO_PAGO" on the column filtered, like this:
NVL(FECHA_PROCESO_PAGO, TO_DATE('01/01/2000'))
-
Then I executed this query:
SELECT /*+INDEX (CP I_FECHA_PROCESO_PAGO) */ * FROM JOSUE.CREDBURS_PAGOS CP WHERE CP.FECHA_PROCESO_PAGO ='01/01/2000';
-
Now the explain plan shows it is taking the index, but the query takes much more than before.