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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T04:39:52+00:00 2026-06-15T04:39:52+00:00

Unfortunately as a temporary measure whilst we fix our datacentre I need to run

  • 0

Unfortunately as a temporary measure whilst we fix our datacentre I need to run the following cross server query, can anyone suggest how I can get the performance to increase…

as have to run this statement at the start of a cursor

SELECT t.SearchId, t.VisitSourceId, t.SiteDomainId, t.trpUTMid, t.FlightPlus, t.StartDate,
t.CountryId, t.ProvinceId, t.Locationid, t.PlaceId, t.EstabId, t.CheckInDate, 
t.CheckOutDate, t.Rooms, t.Room1Adults, t.Room1Children, t.Room2Adults, t.Room2Children, 
t.Room3Adults, t.Room3Children, tc.OutcomeDate, tc.OutcomeId, tc.HotelsFound, tc.Notes

FROM [MLT_VisitTracking].[dbo].TrackingAcomSearches_tbl t
INNER JOIN TrackingAcomSearchesOutcome_tbl tc
ON t.trpUTMid = tc.trpUTMid
LEFT JOIN [YAZOO].[MLT_VisitTracking].[dbo].TrackingAcomSearches_tbl tid
ON t.trpUTMid = tid.trpUTMid
WHERE tid.trpUTMid IS NULL
  • 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-15T04:39:54+00:00Added an answer on June 15, 2026 at 4:39 am

    One possible option would be to get the remote table replicated to the local server. This would put all tables on the same server, enabling the optimizer to use statistics to generate the best plan. Since you are only using trpUTMid, you could just replicate that column.

    Another option would be to use temp tables. Same idea, get all tables on the same server:

    SELECT trpUTMid
    INTO #Yazoo_TrackingAcomSearches_tbl
    FROM [YAZOO].[MLT_VisitTracking].[dbo].TrackingAcomSearches_tbl
    
    
    SELECT t.SearchId, t.VisitSourceId, t.SiteDomainId, t.trpUTMid, t.FlightPlus, t.StartDate,
    t.CountryId, t.ProvinceId, t.Locationid, t.PlaceId, t.EstabId, t.CheckInDate, 
    t.CheckOutDate, t.Rooms, t.Room1Adults, t.Room1Children, t.Room2Adults, t.Room2Children, 
    t.Room3Adults, t.Room3Children, tc.OutcomeDate, tc.OutcomeId, tc.HotelsFound, tc.Notes
    
    FROM [MLT_VisitTracking].[dbo].TrackingAcomSearches_tbl t
    INNER JOIN TrackingAcomSearchesOutcome_tbl tc
    ON t.trpUTMid = tc.trpUTMid
    LEFT JOIN #Yazoo_TrackingAcomSearches_tbl tid
    ON t.trpUTMid = tid.trpUTMid
    WHERE tid.trpUTMid IS NULL
    

    You could also create an index on the temp table to improve performance.

    I’d also recommend checking for lack of existence rather than the old left join where null ( read this for more info ):

    SELECT trpUTMid
    INTO #Yazoo_TrackingAcomSearches_tbl
    FROM [YAZOO].[MLT_VisitTracking].[dbo].TrackingAcomSearches_tbl
    
    
    SELECT t.SearchId, t.VisitSourceId, t.SiteDomainId, t.trpUTMid, t.FlightPlus, t.StartDate,
    t.CountryId, t.ProvinceId, t.Locationid, t.PlaceId, t.EstabId, t.CheckInDate, 
    t.CheckOutDate, t.Rooms, t.Room1Adults, t.Room1Children, t.Room2Adults, t.Room2Children, 
    t.Room3Adults, t.Room3Children, tc.OutcomeDate, tc.OutcomeId, tc.HotelsFound, tc.Notes
    
    FROM [MLT_VisitTracking].[dbo].TrackingAcomSearches_tbl t
    INNER JOIN TrackingAcomSearchesOutcome_tbl tc
    ON t.trpUTMid = tc.trpUTMid
    WHERE NOT EXISTS (
        SELECT NULL 
        FROM #Yazoo_TrackingAcomSearches_tbl
        WHERE trpUTMid = t.trpUTMid
    )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Unfortunately, I often find I need to reboot to wipe some unhealthy Xcode state.
Unfortunately I haven't coded Java for about five years and I absolutely can not
I have created a temporary table using cakephp $this->Model->query() and inserted some records using
The purpose of this query is to act like a search. Unfortunately the query
Specifically, we are trying to upgrade our telerik controls to the latest version. Unfortunately,
One of our partners provided us with an assembly we need to access from
I have multiple entries in a temporary table in Database, and I need to
In our current project we are providing a PDF download that can be customized
Unfortunately, I have to deal with J2ME (which I consider ancient technology these days)
Unfortunately, I have to use a C library with internal state in my Android

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.