|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Thursday, May 16, 2013 3:36 AM
Points: 2,522,
Visits: 3,616
|
|
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
|
|
|
|
|
SSC Eights!
      
Group: General Forum Members
Last Login: Monday, May 06, 2013 6:51 AM
Points: 989,
Visits: 1,790
|
|
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.
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Thursday, May 16, 2013 3:36 AM
Points: 2,522,
Visits: 3,616
|
|
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
|
|
|
|
|
SSC Eights!
      
Group: General Forum Members
Last Login: Monday, May 06, 2013 6:51 AM
Points: 989,
Visits: 1,790
|
|
| If 20 million rows a month are getting added on average, I think you can assume that there are no empty partitions. Come on.
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Friday, April 12, 2013 9:43 AM
Points: 142,
Visits: 171
|
|
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?
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Today @ 5:18 AM
Points: 5,233,
Visits: 7,028
|
|
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
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Friday, April 12, 2013 9:43 AM
Points: 142,
Visits: 171
|
|
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.
|
|
|
|
|
Valued Member
      
Group: General Forum Members
Last Login: Monday, August 06, 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.
|
|
|
|