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

  • Home
  • SEARCH
  • 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 6042223
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T06:45:58+00:00 2026-05-23T06:45:58+00:00

Sorry if the title is confusing, I am finding it difficult to clearly word

  • 0

Sorry if the title is confusing, I am finding it difficult to clearly word my question.

Here is my scenario:
I have a table called SUBSCRIBERS that has two non-unique indexes. The columns indexed are AREA_ID and SUBSCRIPTION_DATE.

Now, I want to (efficiently) query for all subscribers in a specific area who have subscribed after a given date. Example SQL:

SELECT *
FROM subscribers
WHERE area_id = 'areaID'
AND subscription_date > to_date(some_date)

So let’s say to execute this query, Oracle first grabs all the rows with given areaID, and let’s say this is still a very large number of rows. Will Oracle be able to do a range scan on this subset of rows by subscription date? Or does the non-unique subscription_date index only apply to the FULL table, meaning that Oracle will have to do a linear scan over the subset?

Also, I’m not sure what the technical phrase would be to describe an index on a set that also applies to subsets. That would be a cool bonus if anyone knows the correct terminology.

  • 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. Editorial Team
    Editorial Team
    2026-05-23T06:45:59+00:00Added an answer on May 23, 2026 at 6:45 am

    Depending on the Oracle version, it is possible that both indexes could be used. However, in order to do this, Oracle would have to convert both b-tree indexes to bitmap indexes and do a bitmap merge on the two. This is not a particularly efficient operation, so it is not generally not a query plan that you’d want.

    Oracle b-tree indexes work by storing the key and the ROWID in the table where the key occurs. In order to combine the indexes, Oracle first converts them to a bitmap index which is essentially a two-dimensional array that indicates which row meets which criteria. It can then combine the two bitmap indexes relatively easily. The complexity of this operation is in the initial conversion of the b-tree index into a bitmap index. In principle, nothing prevents Oracle from implementing a query plan that fetches all the ROWIDs from both indexes and perform an intersection of the two sets. I assume, however, that the bitmap conversion path is more efficient in general because that’s what Oracle implemented.

    Jonathan Lewis has a section on bitmap conversions in his book Cost-Based Oracle Fundamentals.

    It would almost certainly be more efficient to have a composite index on (AREA_ID,SUBSCRIPTION_DATE). That would allow you to do an index range scan on the single composite index. Queries that just had a predicate on AREA_ID would be able to use this composite index so the index on AREA_ID would generally be made redundant.

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

Sidebar

Related Questions

Sorry if the title is confusing. Here is the query I have Select MONTH(DATE(TIMESTAMP)),
Sorry the title isn't more help. I have a database of media-file URLs that
Sorry for the confusing title, but it basically says it all. Here's the structures
Sorry for the long question title. I guess I'm on to a loser on
Sorry for the basic question - I'm a .NET developer and don't have much
Sorry if the title seems confusing, but some examples are in order. Let's say
I'm sorry if the title is confusing but I couldn't think of anything similar
First off, sorry if the title is confusing! I'm working on a part of
Sorry for the confusing title.... We are developing an application to be used by
Sorry for the confusing title. I tried to make it less verbose, but... What

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.