|
|
|
SSC-Dedicated
           
Group: Administrators
Last Login: Yesterday @ 5:37 PM
Points: 31,521,
Visits: 13,855
|
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Yesterday @ 5:53 PM
Points: 7,179,
Visits: 7,276
|
|
Nice easy question.
If there were more like this I would have a better score.
Tom Is minic a gheibheann béal oscailte dorn dúnta. Is minig a cheapas beul fosgailte dòrn dùinte.
http://es.linkedin.com/in/tomthomsonsoftware
|
|
|
|
|
SSCommitted
      
Group: General Forum Members
Last Login: Tuesday, June 11, 2013 2:03 AM
Points: 1,768,
Visits: 1,313
|
|
Tom,
Yes, easy and that too have 2 points 
Cheers!
--------------------------------------------------- "Thare are only 10 types of people in the world: Those who understand binary, and those who don't."
|
|
|
|
|
SSCrazy Eights
        
Group: General Forum Members
Last Login: Yesterday @ 2:54 AM
Points: 9,409,
Visits: 6,494
|
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Yesterday @ 2:27 AM
Points: 2,545,
Visits: 3,646
|
|
The answer does not sound right to me. For heaps, there are no page splits, therefore the only counter that gives me the answer for both, indexes & heaps, is the Pages Allocated/sec counter.
-- CleanUp DROP TABLE dbo.Test GO USE master GO DROP DATABASE Test GO
SET NOCOUNT ON CREATE DATABASE Test GO USE TEST GO CREATE TABLE dbo.Test (id TINYINT NOT NULL, String VARCHAR(5000)) -- Enable or disable the below statement to test for Heap or for Clustered Index --CREATE CLUSTERED INDEX idxid ON dbo.test (id)
-- Insert test data: -- The first row will remain on the same page -- The second row will be inserted into the first page, but we will update the row later -- to a size that does not fit on that page anymore, and therefore will trigger a new page allocation. INSERT dbo.Test VALUES (1,REPLICATE('A',5000)) INSERT dbo.Test VALUES (2,REPLICATE('A',1)) GO -- Pause here for a second or so - we want to measure the Update, not the above inserts.
-- Now move the record to a new page by increasing the size UPDATE dbo.Test SET String = REPLICATE('A',5000) WHERE ID = 2 GO
Best Regards,
Chris Büttner
|
|
|
|
|
SSCarpal Tunnel
       
Group: General Forum Members
Last Login: Tuesday, June 04, 2013 7:03 AM
Points: 4,443,
Visits: 7,249
|
|
I discounted Page splits/sec because page splits are also caused by INSERT statements, and therefore if you wanted to measure the rate at which UPDATE statements cause data to be moved, you may get some misleading results.
Have I missed something, or did I misread the question?
John
|
|
|
|
|
Mr or Mrs. 500
      
Group: General Forum Members
Last Login: Thursday, June 06, 2013 5:57 AM
Points: 557,
Visits: 1,365
|
|
Nice question. The answer seemed too obvious, i was looking for the gotcha.
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Yesterday @ 10:29 PM
Points: 2,178,
Visits: 3,599
|
|
John Mitchell-245523 (5/9/2011) I discounted Page splits/sec because page splits are also caused by INSERT statements, and therefore if you wanted to measure the rate at which UPDATE statements cause data to be moved, you may get some misleading results.
Have I missed something, or did I misread the question?
John
I agree with you John.
Mohammed Moinudheen
|
|
|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Friday, October 12, 2012 7:03 AM
Points: 249,
Visits: 224
|
|
This link might also help too http://www.sql-server-performance.com/faq/reduce_page_splits_p1.aspx
|
|
|
|
|
SSC-Dedicated
           
Group: Administrators
Last Login: Yesterday @ 5:37 PM
Points: 31,521,
Visits: 13,855
|
|
Christian Buettner-167247 (5/9/2011) The answer does not sound right to me. For heaps, there are no page splits, therefore the only counter that gives me the answer for both, indexes & heaps, is the Pages Allocated/sec counter.
While you are correct that page splits do not occur for heaps, it also means that there is no movement to new pages. This isn't pages used for data, the question asked for pages on which data is moved.
Follow me on Twitter: @way0utwest
 Forum Etiquette: How to post data/code on a forum to get the best help
|
|
|
|