Showing posts with label understanding. Show all posts
Showing posts with label understanding. Show all posts

Wednesday, March 21, 2012

How many partitions

Hi,

in a cube a good partitioning schema is essential in my understanding. We have a requirement of a near realtime cube with quite some load in it (gigabytes of data added and changed every day throughout the day). To get around the ROLAP we were looking for having small partitions which can quickly be reloaded using proactive caching when they have changed data.

Is there any "practical" limit on partitions? Does having many partitions mean that you might have some critical overhead? We might think about having 7000 partitions or more...

Thanks,

7000 partitions is a bit much. Technically doable, we have no hard-coded limit on the number of partitions, but operationally you may have difficulty managing such a large number of partitions.

In Project REAL, we are currently using about 1500 and it is manageable, but you can feel the impact when using the tools, e.g. openning up the database in SSMS, or drilling down into the measure groups. The only performance impact we've seen so far is that having a large number of partitions has meant that we've had to increase some of the thread counts to be larger. If you think about it, it makes sense because AS parallelizes execution based on queries to partitions and then merges the results. Thus so long as your queries resolve to just a few partitions, then the normal configurations for thread counts is OK. However, if you query outside of the partitioning scheme, where you are issuing queries which are not constrained by the physical parititions then theoetically you could issue a partition which forces the system to scan 7000 partition before it can return results. Thus for a heavily parititoned system it is very important to partition based on your query patters.

For more information on Project REAL, see http://www.microsoft.com/sql/bi/ProjectREAL I don't think that we talk about this much in our current white papers (it is coming out as we conduct our performance studies), but it will be discussed in the performance findings white paper.

I think you will be a lot happier if you could target something closer to 700 partitions for your first system. Then if you wanted to go larger based on your observations, you could.

_-_-_ Dave

|||

Dave,

in our first project on SSAS 2005 we already experienced performance problems of the tools (BI Dev Studio) with very view partitions. In my case I think partitions could be managed by scripts like you did in Project REAL. But you might be right, the number of partitions will be much more and the boxes I have to run SSAS on are far not as "nice" as you had... The only thing was that I get the source data already partitioned in that way. So it would be very easy to setup these partitions. But if they are not manageable, what does that help...

Thanks

Wednesday, March 7, 2012

how if esle statement works?

hi, everybody!

I have some problems with understanding howif esle statment in sql works. I'm trying to write my owncount()-function and its not working withif else :(( I've already implemented it withcase:
select sum(case (hiredate) when (null) then 0 else 1 end) as 'Count' from emp

It's working perfect. Now I want to have the same but usingif else:
select sum(
if( hiredate is null)
begin 0 end
else 1)
as 'Count' from emp

the error message is:
Msg 156, Level 15, State 1, Line 2
Incorrect syntax near the keyword 'if'.
Msg 102, Level 15, State 1, Line 3
Incorrect syntax near '0'.

What is wrong here?

Artur:

If / else does not work within the context of a select list like this; you need to implement as your first select statement with case statement or use a where condition such as something like:

select count(*)
from emp
where hiredate is not null

|||I think you are right, its not possible to use if/esle within select statement.
Thanks!!!
|||In SQL Server, IF - Else is a control flow statement that allows you to conditionaly run blocks of T-SQL code. Case is an expression that can be used inside some statements. SQL Server does not have a CASE Statement like some other languages.|||Artur,

You can have an 'if/then/else' statement within your code, it's just that you have to put 'case when' instead of 'if'. It works exactly the same way.

Try:

select sum(case when hiredate is null then 0 else 1 end) as 'Count'
from emp

Rob