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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T08:36:54+00:00 2026-05-13T08:36:54+00:00

I have a query like the following: SELECT t1.v3, t2.v2 FROM t1 INNER JOIN

  • 0

I have a query like the following:

SELECT t1.v3, t2.v2
FROM t1
INNER JOIN t2
ON t1.v1 = t2.v1
WHERE ISNULL(t1.DeleteFlag,'N') = 'N'

I have an index in place that I think should result in there being an Index Seek for the = 'N' part but instead I am seeing a very expensive Index Scan. Is it possible that the ISNULL is messing up the correct use of indexes? Does it even make sense to have an index on a column that will only have a few possible values (like DeleteFlag will)?

  • 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-13T08:36:54+00:00Added an answer on May 13, 2026 at 8:36 am

    Yes, any function calls in your WHERE clause will likely make the index useless. Try to rewrite it so that the index can be used:

    SELECT t1.v3, t2.v2
    FROM t1
    INNER JOIN t2
    ON t1.v1 = t2.v1
    WHERE NOT t1.DeleteFlag = 'Y'
    

    The index makes sense if the number of results you expect from the query is much smaller than the total number of rows in the table.

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

Sidebar

Related Questions

I currently have the following query SELECT table1.col1, table2.col2 FROM table1 INNER JOIN table2
I have following SQL query: SELECT Count(*) AS CountOfRecs FROM tblAccount INNER JOIN tblAccountOwner
I have the following query: SELECT product_description.name, product.quantity,product.price,product_option_value_description.name,product_option_value.quantity FROM product INNER JOIN product_description ON
I have the following query: select count(L.ID) from LA inner join L on (LA.leadid
I have the following query: SELECT ,e.EmployeeCode ,c.CompanyName ,v.Violation FROM dbo.Employee e INNER JOIN
Lets assume i have a query like the following $query_search = SELECT * FROM
I have the following query: SELECT * FROM table_name WHERE (col_1 LIKE '%$keyword%' OR
I have following query , select * from process where name like 'abc'; now
I have the following query: SELECT o.id,o.name FROM object o WHERE ( o.description LIKE
I have the following query sql query: select * from Articles ar left join

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.