Performance advantage of XmlReader lost in AS 2005? -
03-03-2006
, 02:11 AM
The XmlReader has a clear better performance than CellSet in AS 2000
specially for large scale data. but I tested some mdx then found it almost
lost in AS 2005, the cellset can run fast as XmlReader.
Here is an example:
string mdx = "select
{[Date].[Calendar].[Date].&[1]:[Date].[Calendar].[Date].&[500]} on 0 from
[Finance]";
AdomdCommand cmd = new AdomdCommand(mdx,con);
DateTime start = DateTime.Now;
XmlReader r = cmd.ExecuteXmlReader();
while (r.Read())
{}
r.Close();// very slow but alike action fast in AS 2000
TimeSpan spent = DateTime.Now - start;
this.Text = spent.Seconds.ToString(); // show 48 seconds in my desktop pc.
The cellset also needs 48 seconds to run above mdx.
Additionally, if the above mdx is changed to
"select {[Date].[Calendar].[Date].members} on 0 from [Finance]" which can
return same result, both XmlReader and Cellset need only 3 seconds, I don't
know what reason.
Any comments will be very appreicated. Thanks. |