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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T13:17:48+00:00 2026-05-31T13:17:48+00:00

I want to Query over 14,000,000 documents stored as XML field in SQL Server.

  • 0

I want to Query over 14,000,000 documents stored as XML field in SQL Server.

I’ve generated 1,000,000 rows in data base to test now, but simple select with no where condition takes about 3 minutes. I also applied XML Indexing but it’s still not acceptable in performance. Similar scenario takes 19 Sec for similar table which have all fields as typed.

Here is my typed table:

CREATE TABLE [dbo].[Fields] (
[Id]          BIGINT     IDENTITY (1, 1) NOT NULL,
[Title]       NCHAR (10) NOT NULL,
[Duration]    INT        NOT NULL,
[Cost]        MONEY      NOT NULL,
[Consignee]   BIGINT     NOT NULL,
[Date]        DATETIME   NOT NULL,
[TariffId]    BIGINT     NOT NULL,
[InvoiceType] NCHAR (10) NOT NULL,
[IsPayed]     BIT        NOT NULL
);

and this one is the one XML sample:

<Invoice>
  <Id>1</Id>
  <Title>title</Title>
  <Duration>726643700</Duration>
  <Cost>312118909727165.6133</Cost>
  <Consignee>3120910928797722624</Consignee>
  <Date>4543-07-16T01:40:29.623</Date>
  <TariffId>3120910928797722624</TariffId>
  <InvoiceType>InvoiceType</InvoiceType>
  <IsPayed>1</IsPayed>
</Invoice>

These are indexes I applied:

CREATE XML INDEX idx_xCol_Path on [dbo].[XML] (InvoiceItem)
   USING XML INDEX idx_xCol FOR PATH

CREATE XML INDEX idx_xCol_Value on [dbo].[XML] (InvoiceItem)
   USING XML INDEX idx_xCol FOR VALUE
  • 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-31T13:17:49+00:00Added an answer on May 31, 2026 at 1:17 pm

    My vary tests made my decision change. Xml is great for about 1-2 million records. In my case, the application life time should be more that 3 years with document production velocity.
    So I tried to use tables instead of xml fields. Other possible solution could be a single record, but there was xml document size limit. As I monitor the performance vs record numbers, I found out it dives after a million records. Also, Index files on SQL grow up was not acceptable with this scale.

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

Sidebar

Related Questions

I have a query with over 500,000 rows of data in the output. I
I want to run a query over a table in SQL Server to save
I have a stored procedure running on sql server 2008 looping over a table
I'm inside a cfloop over a query. I want to get an attribute, but
I'm using Solr and I want to facet over a field group. Since group
I have large data set, which I want to query. The query does not
I downloaded a massive amount of rows (over 98,000) from the USDA about plant
I have a table (SQL 2000) with over 10,000,000 records. Records get added at
I want to run a query over an Array or string with PHP Let
i am preparing myself for importing data from excel sheet to sql server 2005.I

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.