best way to avoid full table scan for "column is null" clause
666412Aug 21 2009 — edited Aug 24 2009I have a query that has is null check, and due to that it does full table scan (millions of rows in the table)
SELECT id, x,
LAG (id) OVER (PARTITION BY userid ORDER BY occurred,id) as p_id,
FROM mytable
WHERE X is NULL
What is the best way for me to avoid the full table scan here. I have index for the X column and other required columns.
Thanks