Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

best way to avoid full table scan for "column is null" clause

666412Aug 21 2009 — edited Aug 24 2009
I 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
This post has been answered by Richard Foote on Aug 21 2009
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 21 2009
Added on Aug 21 2009
10 comments
4,658 views