Re: Large XML file opinions

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Oleg Tkachenko [MVP] (oleg_at_NO!SPAM!PLEASEtkachenko.com)
Date: 02/09/05


Date: Wed, 09 Feb 2005 13:03:47 +0200

Marc Thompson wrote:

> I have several large XML files (500-700 MB) that get updated once a day. I
> have an app that will need to Query (read only operations is all I'll ever
> need) these files. Obviously, querying a file this large will be somewhat
> of a challenge because it can't be loaded into memory all at once. Also, I
> am skeptical of the speed of Xpath/Xquery.
>
> I am wondering if I shouldn't just create a table in SQL server, then create
> a routine that dumps the XML file's values into corresponding SQL server
> columns.
>
> More background info, my app will need to query this XML data fairly
> regularly, about every 5 minutes that the app is being used. So speed and
> efficiency are crucial.

Alternatively you may want take a look at XML data type columns in SQL
Server 2005.
Otherwise you would need to load that XML into XPathDocument (read-only
hence simpler, faster and smaller than XmlDocument) and query it.
Optimize your queries (never use // etc).
If your queries are similar ones, you might try XPath indexing using
IndexingXPathNavigator from Mvp.Xml library (http://mvp-xml.sf.net/common).

-- 
Oleg Tkachenko [XML MVP, MCP]
http://blog.tkachenko.com


Relevant Pages

  • RE: Query producing XML appears to be cached
    ... By default the XMLDataSource control always caches its data, ... I have an app that executed a sql server query that produces an XML ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: DTS Global Variables + SQL query
    ... they query I'm trying to run isn't as straight forward as I originally ... >>I'm creating a new Transform Data Task in SQL Server 2000. ... >>'Creating an XML object to read the XML ... > Script Task to set the values to global variables makes sense. ...
    (microsoft.public.sqlserver.dts)
  • Query producing XML appears to be cached
    ... I have an app that executed a sql server query that produces an XML ... actually executing. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Output to XML File
    ... I have a Archival process in a VB.Net app that needs ... > to kick off a stored procedure on a SQL Server 2000 box. ... > statements should return as XML and be output to a file. ... > I'm a complete novice at XML and have only basic experience with SQL ...
    (microsoft.public.sqlserver.programming)
  • Large XML file opinions
    ... I have several large XML files that get updated once a day. ... I am wondering if I shouldn't just create a table in SQL server, ... my app will need to query this XML data fairly ...
    (microsoft.public.dotnet.xml)