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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T16:14:47+00:00 2026-05-15T16:14:47+00:00

This question is theoretical as well as practical. Any results indicating useful resources on

  • 0

This question is theoretical as well as practical. Any results indicating useful resources on optimizing queries will be appreciated.

There is a large SQL database which stores a large amount of data stored in SQLXML fields. Querying the XML directly is not fast enough.

I have looked at some MSDN articles on optimizing SQLXML (i.e. http://msdn.microsoft.com/en-us/library/aa902661(SQL.80).aspx), and I am aware that indexing the searchable xml fields will increase search speed.

Can anyone recommend any additional resources for optimizing databases, either in this environment or in general, that are particularly useful? As always, I appreciate y’alls help

  • 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-15T16:14:47+00:00Added an answer on May 15, 2026 at 4:14 pm

    It depends on what you need to do to your XML. I have a similar setup where the table structure was made “generic” and anything product-specific was stashed into an XML field.

    We also noticed the hard way that querying the XML is not exceptionally fast…. and using XML indices (which SQL Server offers, too) caused our database size to jump from roughly 1 GB to over 10 GB…..

    What we’re doing now for select elements from the XML is this:

    • create a user-defined function which gets the XML contents as its parameter
    • extract the value from that XML parameter
    • using that UDF to define a computed, persisted column in the parent table

    With this, we can extract certain key values (e.g. “ProductID” or “ProductName”) from the XML, and store them on the parent table as a column. It’s computed, e.g. it’s always up to date, and since it’s also persisted, it’s stored with the table data, e.g. it isn’t constantly re-queried and re-computed. And since it’s persisted with the table data, you can even put an index on it.

    This works very well, but it only works for cases where you have isolated, single-value things that you want to fish out of the XML. For that case, it’s a great solution, and it does speed up queries on those values by several orders of magnitude.

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

Sidebar

Related Questions

My question is not exactly the same as this one (it's not theoretical, there
This is mostly a theoretical question I'm just very curious about. (I'm not trying
This is a purely theoretical question. Given three simple classes: class Base { }
This is a pretty-much theoretical question, but.. How much of an operating system could
This question would probably apply equally as well to other languages with C-like multi-line
(This question is over 6 years old and probably no longer has any relevance.)
This question is kind of an add-on to this question In C#, a switch
This question and answer shows how to send a file as a byte array
This question comes on the heels of the question asked here . The email
This question is a follow up to my previous question about getting the HTML

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.