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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T07:53:32+00:00 2026-05-24T07:53:32+00:00

Does anybody have any tips/tricks as to how to improve performance in the following

  • 0

Does anybody have any tips/tricks as to how to improve performance in the following scenario:

  • I have a record set of approx. 500,000 rows.
  • There’s a lot of data being pulled for this query. In order to minimize the query time, I’ve broken this up into several smaller queries; all stored in temp tables with indexes and such. At the end; I assemble all the smaller queries into one temp table to serve as the “master” record for the final query.
  • Current execution time for the above step is approximately 2 minutes (not too bad, considering the amount of data being pulled)
  • The final result needs to be delivered in XML format. When writing my final query, I’m using FOR XML EXPLICIT to put this into the proper format.
  • The problem I’m running into is that the above XML query is taking 30+ minutes, which is way too long in this case.

So, I do have a couple options here:

  • I’d be able to “pre-load” this data into an actual table, and then query off that instead of using temp tables. I’m not sure this will buy me much time, as the issue isn’t with loading the data, but rather the long time that it takes to generate the XML.
  • The above XML will eventually be loaded into our C# codebase to be uploaded to its final destination. Does it make more sense to simply load the record set into C#, and do the XML transformation there, instead of doing it on the database side?
  • Right now I’m using FOR XML EXPLICIT; are there any performance benefits gained by using any of the other XML modes (RAW, AUTO, PATH)?

Thanks again.

~Jim

  • 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-24T07:53:32+00:00Added an answer on May 24, 2026 at 7:53 am

    This is your option right here. XML transformation is going to be far more efficient in C# than in SQL.

    The above XML will eventually be loaded into our C# codebase to be
    uploaded to its final destination. Does it make more sense to simply
    load the record set into C#, and do the XML transformation there,
    instead of doing it on the database side?

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

Sidebar

Related Questions

Does anybody have any suggestions on how to improve the following statements: insert into
Does anybody have any tips for utilizing multiple languages at the same time? I
Following this rather comical interview with a Facebook employee... Does anybody have any details
Does anybody have any reference material that details Cauchy-Reed algorithm? Googling for Cauchy-Reed Solomon
Does anybody have any experience with different fonts for OCR? I am generating an
does anybody have any experience writing up a offline data storage & access app
does anybody have any idea what's does this mean: onLoad=MyOnLoad? thanks
Does anybody have any advice on working in a Date Driven Development environment? Essentially,
Does anybody have any experience/ knowledge in installing the aspImage.dll on a 64-bit Windows
Does anybody have any experience with TFS no longer letting somebody queue a new

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.