May 6, 2010 at 5:03 pm
Jeff Moden (5/6/2010)
I'm not sure where you found the time to study that but, like Seth said, I learn something new every day. I didn't know why it worked well... I just knew it did. Thanks for the education, Paul.
I find the internals fascinating, so spend a lot of my free time with this sort of analysis. Most of the information is publicly available in one form or another - though I did have to confirm that SQL Server (almost always) uses a binary search algorithm to find index key values from the pointers in the page slot array, with Paul Randal (via Twitter as it happens ;-))
Paul White
SQLPerformance.com
SQLkiwi blog
@SQL_Kiwi
May 6, 2010 at 7:58 pm
To know that much about SQL Server... AND be able to write C# code. Way to make the rest of us look like schmucks ;-).
May 7, 2010 at 1:31 am
Paul White NZ (5/6/2010)
Jeff Moden (5/6/2010)
I'm not sure where you found the time to study that but, like Seth said, I learn something new every day. I didn't know why it worked well... I just knew it did. Thanks for the education, Paul.I find the internals fascinating, so spend a lot of my free time with this sort of analysis. Most of the information is publicly available in one form or another - though I did have to confirm that SQL Server (almost always) uses a binary search algorithm to find index key values from the pointers in the page slot array, with Paul Randal (via Twitter as it happens ;-))
I'm impressed, very impressed.
Couldn't say it better than Seth did.
Thank you, Paul, this is an excellent piece of knowledge.
-- Gianluca Sartori
May 7, 2010 at 4:26 am
Garadin (5/6/2010)
To know that much about SQL Server... AND be able to write C# code. Way to make the rest of us look like schmucks ;-).
Hey look so I've picked up a few things about a few things but:
a) I understand less than 1% of SQL Server; and
b) Any decent .NET developer will laugh at my C# efforts
Summary: I'm a schmuck too. 😀
Paul
Paul White
SQLPerformance.com
SQLkiwi blog
@SQL_Kiwi
June 1, 2010 at 11:41 am
Paul White NZ (5/5/2010)
Jeff Moden (5/5/2010)
I missed that one. Could you please provide the URL ?
June 1, 2010 at 12:09 pm
j-1064772 (6/1/2010)
Paul White NZ (5/5/2010)
Jeff Moden (5/5/2010)
Doesn't this remind you of the 'triangular join' I surprised you with a few weeks back? The one with the computed column CASE expression on the NULLs? I don't recall the exact details...I missed that one. Could you please provide the URL ?
URL to what? The Triangular Join article or ???
Keep in mind that whatever you surprised me with a few weeks back was a few hundred posts back for me.
--Jeff Moden
Change is inevitable... Change for the better is not.
June 1, 2010 at 12:40 pm
Jeff Moden (6/1/2010)
j-1064772 (6/1/2010)
Paul White NZ (5/5/2010)
Jeff Moden (5/5/2010)
Doesn't this remind you of the 'triangular join' I surprised you with a few weeks back? The one with the computed column CASE expression on the NULLs? I don't recall the exact details...I missed that one. Could you please provide the URL ?
URL to what? The Triangular Join article or ???
Keep in mind that whatever you surprised me with a few weeks back was a few hundred posts back for me.
I meant the surprise about the trinagular join.
June 1, 2010 at 1:15 pm
Paul White NZ (5/7/2010)
Garadin (5/6/2010)
To know that much about SQL Server... AND be able to write C# code. Way to make the rest of us look like schmucks ;-).Hey look so I've picked up a few things about a few things but:
a) I understand less than 1% of SQL Server; and
b) Any decent .NET developer will laugh at my C# efforts
Summary: I'm a schmuck too. 😀
Paul
Paul, I'd love to get elavated to your level of schmuck-iness!
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
June 2, 2010 at 12:09 am
j-1064772 (6/1/2010)
I missed that one. Could you please provide the URL ?
Sure can:
http://www.sqlservercentral.com/Forums/Topic896583-338-1.aspx
Paul White
SQLPerformance.com
SQLkiwi blog
@SQL_Kiwi
June 2, 2010 at 5:16 am
Paul White NZ (6/2/2010)
j-1064772 (6/1/2010)
I missed that one. Could you please provide the URL ?Sure can:
http://www.sqlservercentral.com/Forums/Topic896583-338-1.aspx
Ohhh! That! I didn't realize he'd quoted you, Paul.
Yeah... that was pretty cool.
--Jeff Moden
Change is inevitable... Change for the better is not.
June 2, 2010 at 5:25 am
Jeff Moden (6/2/2010)
Ohhh! That! I didn't realize he'd quoted you, Paul.
He made a bit of a mess of the quote tags :pinch: 🙂
Paul White
SQLPerformance.com
SQLkiwi blog
@SQL_Kiwi
June 2, 2010 at 7:59 am
Paul White NZ (5/7/2010)
Garadin (5/6/2010)
To know that much about SQL Server... AND be able to write C# code. Way to make the rest of us look like schmucks ;-).Hey look so I've picked up a few things about a few things but:
a) I understand less than 1% of SQL Server; and
b) Any decent .NET developer will laugh at my C# efforts
Summary: I'm a schmuck too. 😀
Paul
Real schmucks are the guys who think they know everything there is to know about SQL Server and blindly repeat the same bad patterns over and over again while informing everyone else that they're doing it wrong.
"Do not seek to follow in the footsteps of the wise. Instead, seek what they sought." - Matsuo Basho
September 8, 2011 at 6:32 am
Jeff,
Your gap detection code is very sweet...
However, I'm wondering what you think of the use of a tally table vs your gap detection if the requirement is to find the first (or any) available number within a range?
Thanks!
Charles Wilt
September 8, 2011 at 6:45 am
wiltc-836148 (9/8/2011)
Jeff,Your gap detection code is very sweet...
However, I'm wondering what you think of the use of a tally table vs your gap detection if the requirement is to find the first (or any) available number within a range?
Thanks!
Charles Wilt
Thanks for the feedback, Charles...
No... Gap detection isn't one of the jobs that the Tally Table is real performant at because it requires a JOIN to the data and then a comparison. It would be much quicker to just use a TOP 1 with the "Gap Start" part of the code.
--Jeff Moden
Change is inevitable... Change for the better is not.
September 8, 2011 at 7:26 am
Jeff Moden (9/8/2011)
Thanks for the feedback, Charles...
No... Gap detection isn't one of the jobs that the Tally Table is real performant at because it requires a JOIN to the data and then a comparison. It would be much quicker to just use a TOP 1 with the "Gap Start" part of the code.
Jeff,
I'm actually still trying to wrap my head around the code...so I'm not sure I understand what you mean by using just the "Gap Start".
It seems to me, that the only thing I could take out is the line
GapEnd = hi.MyID - 1
which would have little effect on performance...
Am I missing something?
Thanks again!
Charles
Viewing 15 posts - 46 through 60 (of 61 total)
You must be logged in to reply to this topic. Login to reply