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 have created a table on an Oracle 10g database with this structure :
Alright, need some help created a query for an Oracle 10g DB. I have
I have this query in Oracle 10g: DELETE FROM BMAN_TP1.CELLS_ITEM TABLE1 WHERE EXISTS (
I have an application that records activity in a table (Oracle 10g). The logging
i have 2 Date field's in oracle 10g (MyDate and MyTime) and i need
I have this table: create table demo ( key number(10) not null, type varchar2(3)
I am working on a query for a report in Oracle 10g. I need
I have a c# client and I am using oracle 10g database. My query
I have Oracle 10g xe installed but i also need to install Oracle Database
I'm using Oracle 10g. I have a table with a number of fields of

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.