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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T23:35:52+00:00 2026-06-17T23:35:52+00:00

My question about searching queries with .NOT . I’m confused which is faster for

  • 0

My question about searching queries with .NOT . I’m confused which is faster for loading and process SQL query, I have implemented SQL Server query and my query getting larger and slow of fetching data even though I’m using indexing search with SQL Server 2012.

So is there any way to make my query faster with linq?

Here is simple of my query

SELECT
    counting 
FROM  
    xxxxxxx 
WHERE
   (Contains(BOOLEANTEXT, '"FORM"')) 
   AND ((Contains(BOOLEANTEXT, ' "FORM"  and  "WARRANT" ' ))) 
   AND ((Contains(BOOLEANTEXT, ' "RETURN"  or  "RESPECTING"  or  "ELECTION"  or  "EXPENSES" ')))  
   OR ((Contains(BOOLEANTEXT, 'Near((FORM,WARRANT,RETURN,RESPECTING,ELECTION,EXPENSES), 1000, TRUE)' ))) 
   AND ((Contains(BOOLEANTEXT, 'FORMSOF(INFLECTIONAL, FORM,WARRANT,RETURN,RESPECTING,ELECTION,EXPENSES)' ))) 
   AND ((Contains(BOOLEANTEXT, 'FORMSOF(THESAURUS, FORM,WARRANT,RETURN,RESPECTING,ELECTION,EXPENSES)' ))) 
ORDER BY 
   FORMTITLE ASC
  • 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-06-17T23:35:53+00:00Added an answer on June 17, 2026 at 11:35 pm

    No, there is no way of improving the performance of this query with LINQ.

    There will even be a slight overhead when using LINQ, but that will for sure be neglectable in this case.

    LINQ will eventually also produce SQL and execute it on your database. So LINQ will not provide any performance benefits.

    If you want to improve performance, you’ll have to improve this SQL-statement itself.

    Looking at your WHERE-clause, there are no brackets to combine any of the AND‘s to that single OR. Is that on purpose? Your results will now satisfy all AND-conditions OR ((Contains(BOOLEANTEXT, 'Near((FORM,WARRANT,RETURN,RESPECTING,ELECTION,EXPENSES), 1000, TRUE)' )))

    This might get you a lot more results than you are expecting.


    Some more on the AND‘s and OR.

    Your WHERE-clause is now similar to:

    (condition1 AND condition2 AND condition3 AND condition5 AND condition6)
    OR condition4
    

    I suppose, you actually mean something like:

    condition1 AND condition2
    AND (condition3 OR condition4)
    AND condition5 AND condition6
    

    I don not say your WHERE-clause is wrong. I only suspect you need some extra brackets somewhere, to get the WHERE-clause you had in mind.

    But before adding brackets, let’s remove some to improve readability. This will do the same as yours:

    WHERE
       Contains(BOOLEANTEXT, '"FORM"')
       AND Contains(BOOLEANTEXT, ' "FORM"  and  "WARRANT" ')
       AND Contains(BOOLEANTEXT, ' "RETURN"  or  "RESPECTING"  or  "ELECTION"  or  "EXPENSES" ')
       OR Contains(BOOLEANTEXT, 'Near((FORM,WARRANT,RETURN,RESPECTING,ELECTION,EXPENSES), 1000, TRUE)') 
       AND Contains(BOOLEANTEXT, 'FORMSOF(INFLECTIONAL, FORM,WARRANT,RETURN,RESPECTING,ELECTION,EXPENSES)') 
       AND Contains(BOOLEANTEXT, 'FORMSOF(THESAURUS, FORM,WARRANT,RETURN,RESPECTING,ELECTION,EXPENSES)')
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a question about XNA which I am new too and could not
I have one question about searching and counting files in directories and subdirectories. I
I have a question, I am searching for about an hour now. A given
I have spent about half a day searching for an answer to this question
I've done some searching around but I have a specific question on SQL Injection
This is not a programming question per se but a question about searching source
This is some what of a supplementary question to my recent query about searching
Have a question about full text search. I have a query that works, but
I have a small question about stored procedures and the DateTime2 datatype in SQL
I have a question about searching the JSON for the specific information. For example,

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.