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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T08:03:54+00:00 2026-06-14T08:03:54+00:00

We have a query in our system that has been a problem in the

  • 0

We have a query in our system that has been a problem in the amount of logical reads it is using. The query is run often enough (a few times a day), but it is report in nature (i.e. gathering data, it is not transactional).

After having a couple of people look at it we are mulling over a few different options.

  1. Using OPTION (FORCE ORDER) and a few MERGE JOIN hints to get the optimizer to process the data more efficiently (at least on the data that has been tested).

  2. Using temp tables to break up the query so the optimizer isn’t dealing with a very large query which is allowing it process it more efficiently.

We do not really have the option of doing a major schema change or anything, tuning the query is kind of the rallying point for this issue.

The query hints option is performing a little better than the other option, but both options are acceptable in terms of performance at this point.

So the question is, which would you prefer? The query hints are viewed as slightly dangerous because it we are overriding the optimizer etc. The temp table solution needs to write out to the tempdb etc.

In the past we have been able to see large performance gains using temp tables on our larger reporting queries but that has generally been for queries that are run less frequently than this query.

  • 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-14T08:03:55+00:00Added an answer on June 14, 2026 at 8:03 am

    if you have exhausted optimizing via indexes and removed non-SARGABLE sql then I recommend going for the temp tables option:

    1. temp tables provide repeatable performance, provided they do not put excessive pressure on the tempdb in terms of size increase and performance – you will need to monitor those
    2. sql hints may stop being effective because of other table/index changes in the future
    3. remember to clean up temp tables when you are finished.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using in C# MYsql .I have query that works if I run
We have a query that is taking around 5 sec on our production system,
I have a tool that is setup to query our Clearquest Database to return
In our application we have a little query that looks like this: var selectedAgents
In our backoffice we have a core-system that generates models from the DB. When
I'm trying to query by iteration but our iteration names have special characters (e.g.
I have query table copyQuery which has Soil Condition has one of the columns,
I have a query that successfully grabs the unique products from my products table
We have a system that will use the same code to communicate with different
Our system has structured model (about 30 different entities with several kind of relations)

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.