Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase «««123

How many partitions? Expand / Collapse
Author
Message
Posted Friday, August 13, 2010 5:03 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Today @ 12:47 AM
Points: 2,840, Visits: 3,872
Hi,

I was not sure about the history data. Although the QOTD specified that an average of 20000 rows per month were imported, it did not tell you that all months really contained data. And without that knowledge, any numbers could have come out of that query.


Best Regards,
Chris Büttner
Post #968787
Posted Friday, August 13, 2010 7:24 AM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Monday, August 18, 2014 7:25 AM
Points: 989, Visits: 1,823
Christian Buettner-167247 (8/13/2010)
Hi,

I was not sure about the history data. Although the QOTD specified that an average of 20000 rows per month were imported, it did not tell you that all months really contained data. And without that knowledge, any numbers could have come out of that query.


That was a red herring, how much history went into the DB. The query was searching for number of partitions, and between 22 and 25 would return four partitions. The query didn't care how many rows were in those partitions.
Post #968906
Posted Friday, August 13, 2010 7:36 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Today @ 12:47 AM
Points: 2,840, Visits: 3,872
jeff.mason (8/13/2010)
Christian Buettner-167247 (8/13/2010)
Hi,

I was not sure about the history data. Although the QOTD specified that an average of 20000 rows per month were imported, it did not tell you that all months really contained data. And without that knowledge, any numbers could have come out of that query.


That was a red herring, how much history went into the DB. The query was searching for number of partitions, and between 22 and 25 would return four partitions. The query didn't care how many rows were in those partitions.

It does care. Because if there is no data in one partition, then the result varies.


Best Regards,
Chris Büttner
Post #968916
Posted Friday, August 13, 2010 7:39 AM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Monday, August 18, 2014 7:25 AM
Points: 989, Visits: 1,823
If 20 million rows a month are getting added on average, I think you can assume that there are no empty partitions. Come on.
Post #968920
Posted Monday, August 16, 2010 12:38 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Friday, July 18, 2014 8:44 AM
Points: 166, Visits: 199
It does care. Because if there is no data in one partition, then the result varies.


That was my understanding, but the supplied answer seems to say that the function will return a partition number even if that partition has no data. To my eye, $Partition.PF(Key) needs Key values to be supplied if it is to return partition numbers for those Keys.

And can we stop talking about the missing Group By, and concentrate on the meat of this question? Please?






Post #969968
Posted Monday, August 16, 2010 1:32 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 3:13 PM
Points: 5,967, Visits: 8,221
Festeron (8/16/2010)
It does care. Because if there is no data in one partition, then the result varies.


That was my understanding, but the supplied answer seems to say that the function will return a partition number even if that partition has no data. To my eye, $Partition.PF(Key) needs Key values to be supplied if it is to return partition numbers for those Keys.

I have to agree that this part of the explanation is confusing.

$Partition.PF(value) will return the partition where that vallue would be stored, even if that partition (or even the whole table) is currently empty.
But in the query used in this question, the value was taken from actual table data. And it will not return data for rows that don't exist. So this particular query will only return the partitions with at least one row of data in it, but that is not a limitation of the $Partition.PF() function.



Hugo Kornelis, SQL Server MVP
Visit my SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis
Post #970002
Posted Monday, August 16, 2010 1:40 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Friday, July 18, 2014 8:44 AM
Points: 166, Visits: 199

I have to agree that this part of the explanation is confusing.


I am honoured that Hugo agrees with me.

If you feed your own values into the function, then of course you'll get back partition numbers. If you use the table to generate those values, then you won't get back a partition number for partitions that don't contain at least one row.

I cannot agree with the argument that each partition must have rows because there are just so many of them.




Post #970005
Posted Wednesday, August 18, 2010 9:51 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Monday, August 6, 2012 3:06 AM
Points: 63, Visits: 53
None of the available choices were correct so points are being awarded to those who either guessed correctly or read the author's mind. There are valid arguments to be made for claiming that 0, 4 or "syntax error" was the correct answer...27 is obviously just flat out wrong.

I know the point is supposed to be increasing our knowledge by answering/researching the questions and not racking up points, but that theory goes out the window when you keep score...especially on a 3-pointer.
Post #971248
« Prev Topic | Next Topic »

Add to briefcase «««123

Permissions Expand / Collapse