Showing posts with label similar. Show all posts
Showing posts with label similar. Show all posts

Monday, March 26, 2012

Performance degradation in December CTP of AS 2005 SP2

Has anyone had any similar experience with the December CTP of SQL Server 2005 and Analysis Services SP2 ?

We have a simple MDX query which returns 245 rows and 15 columns of data. When running this query through management studio under SP1 it takes 1 second, and when run through an XMLA query it takes 2 seconds.

We have now installed the december CTP of SP2 on an identical server and re-deployed / re-processed the identical cubes to this server. When running this first test query it takes consistently 6 seconds and 20 seconds when run through an XMLA query.

Does anyone have any hints on what could be different in the new CTP that could be behind this ? One thing that I have noticed is that running the MDX as an XMLA query produces tens of thousands of lines of messages under SP2 as opposed to the "Executing the query ... Execution complere" messages under SP1. Is there some server parameter that governs the trace / debug information created and could this be behind the performance degradation we are experiencing ?

Any ideas would be very gratefully recieved

It is very hard to tell anything sure about this.

A wild guess based on what Mosha has written in his Blog is that you have calculated members with a non-correct setting for non-empty behavior.

Edit: Have a look here: http://www.sqljunkies.com/WebLog/mosha/archive/2006/11/05/non_empty_behavior.aspx

Mosha have mentioned this several times but there are no clear guidelines for how to set this correctly.

If you do not have non_empty_behavior set for calculated members/measures or scripts, add it and see if it helps.

If you have non_empty_behavior set for a calculated members/measures or script, remove it and see if it helps.

Regards

Thomas Ivarsson

|||Can you share the query as well as related calculations?|||

Thanks for the replies and sorry for the change in username ... The problem was originally posted under a colleagues ID beforeI created my own.

The MDX Query pasted at the bottom of this message.

The query includes a calculation that I will try to move onto the cube so that I can benefit from the advice on non-empty behaviour and see what impact this has. However, the main concern is still the trying to understand the considerably worse performance under SP2.

Thanks again for any help.

WITH MEMBER [Time Intelligence].[Time Intelligence].[Used Methodology] AS

IIF ( NOT ISEMPTY(( [MethodologyCollection].[Dim Pre Post].&[2] ,[Time Intelligence].[Time Intelligence].&[1])) OR NOT ISEMPTY(( [MethodologyCollection].[Dim Pre Post].&[3] ,[Time Intelligence].[Time Intelligence].&[1])) , 2

, IIF ( ISEMPTY(( [MethodologyCollection].[Dim Pre Post].&[1] ,[Time Intelligence].[Time Intelligence].&[1])) , 3 , 1 ) )

SELECT

{ ([Time Intelligence].[Time Intelligence].&[1],[Display Instruments CC2])

, ([Time Intelligence].[Time Intelligence].[Used Methodology],[Display Instruments CC2])

} ON COLUMNS ,

[Display Countries] ON ROWS

FROM [IBLR Full IFS]

WHERE (

[Measures].[AmountsOutstanding cc2 display]

, [IBLR Currency].[Market].[Currency Total BK].&[1]

, [Quarter].[Year-Quarter].&[2006].&[20060930]

, [Rep Org].[Reporting Organisation].[DK]

, [MethodologyCollection].[Dim Pre Post].[Current Period Methodology]

, [IBLR Data Type].[Data Type BK].Coffee)

|||Can you try the query with connection string property "Cache Policy=9" to see if there is any difference in performance? Management Studio doesn't allow setting connection string property, you have to use MDX Sample from SQL Server 2000 or write your own C# program.|||

Thank you very much for the reply. I have implemented this as you suggested and tested the queries against SP1 and SP2 and the performance is now comparable (even slightly quicker under SP2, although drawing any conclusions from a single query taking 1.1 or 1.2 seconds is probably a little premature :-) ).

I have done a quick search on the online help and through google and have not been able to find any information on this setting, would you be able to provide a brief description of what this property ?

Thanks again for your help.

|||

In addition, I have found that inserting the following into the proprty list of the XMLA query has meant that the time running the XMLA version of the query through management studio has improved from 20 seconds to 1 second.

<DbpropMsmdCachePolicy>9</DbpropMsmdCachePolicy>

The online help (also the version of the help released with the December CTP) for this XMLA property indicates that the property is "Reserved for future use".

|||

This connection string property changes the default execution plan picked by AS in certain cases, for example when there is IIF in the calculation. AS picks the default execution plan as it is the best for most cases. Unfortunately in some cases, such as in your case, the execution plan picked by AS performs far worse than the alternative.

The default setting works best in most cases, therefore, users should only use "Cache Policy=9" when it has demonstrated significant performance boost for a given query. But setting "Cache Policy=9" is likely to cause performance degradation for many other queries. Since It is difficult to change server properties only for certain queries and it is risky to change the default setting, this server property is not widely publicized.

Ideally you should only turn this setting on for the problematic queries. If it is hard to do you have to verify that other queries are not adversely affected by the new setting. This is an area which is likely to see significant improvements in future versions of AS.

performance degradation after several inserts

We have a VB6 app that uses an MSDE SP3 database. We use a process with
transactions to add data to the database. As several similar packets of data
are added we've noticed a degradation in the speed of loading the
information. We've also noticed that if at the end of the insert of several
packets of data we get a 30 second upload time per packet, then shut down
MSDE, start it up again and then insert in an almost identical packet of
data, it will run twice to 3 times faster.
We tried turning autoshrink and auclose off but that didn't seem to help.
Thanks,
Terry
hi Terry,
tgrignon wrote:
> We have a VB6 app that uses an MSDE SP3 database. We use a process
> with transactions to add data to the database. As several similar
> packets of data are added we've noticed a degradation in the speed of
> loading the information. We've also noticed that if at the end of
> the insert of several packets of data we get a 30 second upload time
> per packet, then shut down MSDE, start it up again and then insert in
> an almost identical packet of data, it will run twice to 3 times
> faster.
> We tried turning autoshrink and auclose off but that didn't seem to
> help.
it can depend on the transaction... if you load a big transaction, you will
see a degradation as the transaction size increses... you can perhaps
separate the load into separated transactions..
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
DbaMgr2k ver 0.14.0 - DbaMgr ver 0.59.0
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply
|||Thanks for the reply Andrea!
The loads are separated into different transactions. If I use a monitor I
can see that memory use continues to grow with each load so it seems like
there is a memory leak somewhere.
We are planning to try:
DBCC FREEPROCCACHE
&
DBCC DROPCLEANBUFFERS
in between loads with our next build. Do you have any other suggestions?
multo grazie,
Terry
"Andrea Montanari" wrote:

> hi Terry,
> it can depend on the transaction... if you load a big transaction, you will
> see a degradation as the transaction size increses... you can perhaps
> separate the load into separated transactions..
> --
> Andrea Montanari (Microsoft MVP - SQL Server)
> http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
> DbaMgr2k ver 0.14.0 - DbaMgr ver 0.59.0
> (my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
> interface)
|||hi Terry,
tgrignon wrote:
> Thanks for the reply Andrea!
> The loads are separated into different transactions. If I use a
> monitor I can see that memory use continues to grow with each load so
> it seems like there is a memory leak somewhere.
not a memory leak (or at least...) ... just the standard SQL Server
behavior... plese see http://tinyurl.com/bvpg9 for some details on SQL
Server memory management...

> We are planning to try:
> DBCC FREEPROCCACHE
> &
> DBCC DROPCLEANBUFFERS
> in between loads with our next build. Do you have any other
> suggestions?
do not know I I like that
those to DBCC commands will actually clear the procedure cache... that
usually includes penalty executing statements due to recompilations of
stored procedures, plans, more I/O activity due to refetching of database
pages...
and more, a nasty security requirements for them... they require high
privileges...
http://msdn.microsoft.com/library/de..._dbcc_7q5l.asp
http://msdn.microsoft.com/library/de..._dbcc_512h.asp
that's to say sysadmins and serveradmins membership...
if I could eventually not speed up operations via separating the job into
multiple transactions, I'd think I'd stay with the time degradation...

> multo grazie,
prego, you are welcome
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
DbaMgr2k ver 0.14.0 - DbaMgr ver 0.59.0
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply
|||I see what you mean about the permissions... but we tried
DBCC FREEPROCCACHE
in between loads and it works perfectly... the separate transaction loads
are back down to a manageable load time. I wonder if a stored procedure is
being left "on" somewhere in the code...
Any other ideas?
Thanks,
Terry
"Andrea Montanari" wrote:

> hi Terry,
> tgrignon wrote:
> not a memory leak (or at least...) ... just the standard SQL Server
> behavior... plese see http://tinyurl.com/bvpg9 for some details on SQL
> Server memory management...
>
> do not know I I like that
> those to DBCC commands will actually clear the procedure cache... that
> usually includes penalty executing statements due to recompilations of
> stored procedures, plans, more I/O activity due to refetching of database
> pages...
> and more, a nasty security requirements for them... they require high
> privileges...
> http://msdn.microsoft.com/library/de..._dbcc_7q5l.asp
> http://msdn.microsoft.com/library/de..._dbcc_512h.asp
> that's to say sysadmins and serveradmins membership...
> if I could eventually not speed up operations via separating the job into
> multiple transactions, I'd think I'd stay with the time degradation...
> prego, you are welcome
> --
> Andrea Montanari (Microsoft MVP - SQL Server)
> http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
> DbaMgr2k ver 0.14.0 - DbaMgr ver 0.59.0
> (my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
> interface)
> -- remove DMO to reply
>
>
|||hi,
tgrignon wrote:
> I see what you mean about the permissions... but we tried
> DBCC FREEPROCCACHE
> in between loads and it works perfectly... the separate transaction
> loads are back down to a manageable load time. I wonder if a stored
> procedure is being left "on" somewhere in the code...
no idea... you have to control

> Any other ideas?
nope..
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
DbaMgr2k ver 0.14.0 - DbaMgr ver 0.59.0
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply