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 6227091
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T09:09:17+00:00 2026-05-24T09:09:17+00:00

Consider a table with a bit column indicating whether the object is active or

  • 0

Consider a table with a bit column indicating whether the object is active or inactive where the majority of the items are inactive (closed).

My understanding was that because of the limited number of distinct values for this column (2), the SQL Engine found it more efficient to perform a table scan to find the open items rather than attempt to index over a bit column.

SQL 2008 has a new feature that allows filters on an index. Without know much about the internals of it, I would assume that the index contains a reference to a record only if it meets the filter criteria and that this approach would provide an efficient means of retrieving all of the active records without having to resort to splitting the active records into separate tables or partitions.

I used to place the primary key of the open records records into a table that I used to identify the active records and then joining the main table to this “active list” table to return only the active records.

Is there any reason why using a filtered index for this purpose would not be appropriate in this situation?

  • 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-24T09:09:17+00:00Added an answer on May 24, 2026 at 9:09 am

    A filtered index on an Active bit field is a valid choice.

    You will probably want to add a specific UPDATE STATISTICS for
    filtered indexes (especially on volatile data) that specifically
    updates their stats with a FULLSCAN. The good news is that they are
    likely to be smaller indexes (and therefore easier/less-costly
    statistics to update)

    This is because the update statistics threshold is based on the underlying column rather than the filtered index values only.

    Ref.

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

Sidebar

Related Questions

Consider the following table with a constraint that's a bit daft but simple enough
Consider a simple table with an auto-increment column like this: CREATE TABLE foo (
Consider the following tables: department deptid (type:INT) deptname (type: TEXT) hours (type:INT) active (type:BIT)
Please consider the table bd.nn that contains roughly 19 million records: > SELECT n,
Consider searching a table that contains Apartment Rental Information: A client using the interface
Consider this table on SQL Server wordID aliasID value =========================== 0 0 'cat' 1
Consider a table or CTE structured like this: Name Num ---- ---- Abc 12
For the sake of the example, consider a table create table foo ( contents
Consider this example table (assuming SQL Server 2005): create table product_bill_of_materials ( parent_product_id int
Consider the following table: mysql> select * from phone_numbers; +-------------+------+-----------+ | number | type

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.