Performance Benchmarking: SELECT FOR XML vs customDataSet.GetXML() in .NET

  • Our database currently uses SELECT FOR XML to return xml-formatted data to the busines tier.

    I am planning to rewrite all stored procedures in order to remove XML formatting tasks from database tier and perform XML formatting in busines tier (.NET). Is there any performance benchmarks available here - which option is faster: SELECT FOR XML or customDataSet.GetXML()?

  • I don't know of any. I'd start by writing the new sp and compare results for Execution plans, statistics io and statistics time. I'm not really a .NET developer so determining the performance of .NET in outputing XML from a dataset is beyond me. I would bet that doing the XML in .NET will be faster though, because you aren't sending as much across the wire.

  • Thank you for your response. There are many reasons to do XML conversion on the business tier - for example: the data set migt be requested from the database once and then converted into many different formats (Plain Old XML or ATOM or RSS) in the businerss tier. DOT.NET has very advanced XML conversion classes and was optimized to do this job fast. So generally speaking it might be as fast as SELECT FOR XML and even faster. I was just seeking confirmation of this general benchmark but it doesn't seem like we have any. Thanks any way - will try to post the same question to other forums.

  • If you find anything interesting please post back here.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply