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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T06:22:18+00:00 2026-05-13T06:22:18+00:00

Quick question for the DBA’s out there: Say I have 2 columns on my

  • 0

Quick question for the DBA’s out there:

Say I have 2 columns on my table, IsDeleted (bit) and DeletedDate (datetime). The table contains approx 10,000,000 rows.

IsDeleted is a computed column that checks to see if DeletedDate is NULL; and it returns 1 if it is not, and 0 if it is.

Querying this table will mainly be done on the IsDeleted column.

Could anybody give me some suggestions on where I should apply my index?

Applying it to the IsDeleted field brings in a crop of problems due to SET QUOTED IDENTIFIER being off, which isn’t necessarily a deal breaker, but would cause some additional work.

Would I see any benefit applying it to DeletedDate, even though I’m not querying that field directly? Should I just bite the bullet and add it to IsDeleted? Is the performance difference between the two negligible?

Thanks again; and if you’d like any clarifications; leave me a comment and I’ll update my post.

  • 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-13T06:22:18+00:00Added an answer on May 13, 2026 at 6:22 am

    It doesn’t make sense to put an index on a bit column because it is not selective enough. When executing a query, SQL Server determines the most appropriate indexes to use. If your index is not selective enough, it will be ignored or it may decide to do an index scan instead of an index seek. Either way, it won’t really help all that much.

    Putting the index on the DeletedDate could possibly help with some queries, but filtering on NULL vs. “any value” will probably not be that much help either because of the selectivity.

    I encourage you to read this:
    Seek Vs. Scan

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

Sidebar

Related Questions

No related questions found

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.