Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 165883
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T12:00:01+00:00 2026-05-11T12:00:01+00:00

We have Oracle 10g and we need to query a table (no JOIN s)

  • 0

We have Oracle 10g and we need to query a 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 table scan on a very large table – BAD BAD BAD. The column has an index on it, but it gets ignored in this instance. Are there any solutions to this?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T12:00:02+00:00Added an answer on May 11, 2026 at 12:00 pm

    The optimizer thinks that the full table scan will be better.

    If there are just a few NULL rows, the optimizer is right.

    If you are absolutely sure that the index access will be faster (that is, you have more than 75% rows with col1 IS NULL), then hint your query:

    SELECT  /*+ INDEX (t index_name_on_col1) */         * FROM    mytable t WHERE   col1 IS NOT NULL 

    Why 75%?

    Because using INDEX SCAN to retrieve values not covered by the index implies a hidden join on ROWID, which costs about 4 times as much as table scan.

    If the index range includes more than 25% of rows, the table scan is usually faster.

    As mentioned by Tony Andrews, clustering factor is more accurate method to measure this value, but 25% is still a good rule of thumb.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm running Oracle 10g and have columns with Type_Name TIMESTAMP(6) WITH TIME ZONE When
I have this table: create table demo ( key number(10) not null, type varchar2(3)
I have an Oracle 10g database, and now I need to export, if possible,
In an Oracle 10g environment, I have a statement that needs to be executed
I've got an Oracle 10g database, and I have a third-party jar file. I
I'm using SQL*Plus 9.2 on Oracle 10g enterprise. I have created some scripts that
I have successfully connected to an Oracle database (10g) from C# (Visual Studio 2008)
I have an Oracle table which contains event log messages for an application. We
For a given table 'foo', I need a query to generate a set of
I've got an Oracle 10g database with a table with a structure and content

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.