Presentation is loading. Please wait.

Presentation is loading. Please wait.

A Day in the Life of a Row Eddie Wuerch, mcm

Similar presentations


Presentation on theme: "A Day in the Life of a Row Eddie Wuerch, mcm"— Presentation transcript:

1 A Day in the Life of a Row Eddie Wuerch, mcm
Salesforce Marketing Cloud

2 Hi! I’m Eddie :) SQL Server since 6.5 Microsoft Certified Master
Enterprise Architect - Salesforce Marketing Cloud trillions of rows … 10s billions tx/day … PBs data & indexes … 24x7, no downtimes

3 The Three ‘C’s of Performance
Capacity Configuration Code Disk Performance Memory Capacity Disk Performance Disk Allocation Contention Scans Hotspotting Insert/Update/Delete Metadata Contention TempDB Abuse

4 The Page – 8KB Page header –page metadata Page ID Next Page ID
Page header – 96 bytes Page header –page metadata Page ID Next Page ID Previous Page ID Owning object ID Index ID Index level Free space on page Next row offset …other stuff Page row / index / bitmap / BLOB data – starts at byte 97 Row-offset table – starts at last byte, moves backwards Data page (8KB)

5 First Extent (8 pages – 64KB)
Data File Structure The base unit of data storage is called a page. All pages are 8KB (8192 bytes) Pages are organized into 8-page extents of 64KB Page 0 Head Page 0 Page 1 Page 1 PFS Page 2 Page 2 GAM Page 3 SGAM Page 3 Page 4 Page 5 Page 6 Page 6 DCM Page 7 BCM Page 7 Page 8 Page 9* Page 10 Page 11 Page 15 First Extent (8 pages – 64KB)

6 Bitmap Metadata Pages 8,096 bytes = 64,768 bits
GAM, SGAM, BCM, DCM, IAM, …….. 96b Header P.0 P.1 P.2 P.3 P.4 P.5 P.6 P.7 P.8 P.9 P.10 P.11 P.12 P.13 P.14 P.15 P.16 P.17 P.18 P.19 P.20 P.21 P.22 P.23 P.24 P.25 P.26 P.27 First Extent Second Extent …. 8,096 bytes = 64,768 bits 1 bit/extent = 64,768 extents 64,768 extents * 64KB/extent = ~4GB of disk space per single GAM

7 Some Metadata Page Types
Page 2: GAM – Global Allocation Map 0 = Extent is allocated 1 = Extent is free Page 3: SGAM – Shared Global Allocation Map 0 = Extent is not mixed, or is fully-allocated mixed extent 1 = Extent is shared (Mixed Extent) with at least 1 free page Page 6: DCM – Diff Change Map 0 = Extent has not changed since last full backup 1 = Extent has changed since last full; include in next diff backup Page 7: BCM – Bulk Change Map 1 = Extent contains minimally-logged operations awaiting log backup IAM – Index Allocation Map (1 per index per GAM segment) 1 = Extent holds at least one page for this index

8 More Metadata Page 1: PFS – Page Free Space – One byte per page
Bits 0 – 2: % Full 000: 0% 001: 1-50% 010: 51-80% 011: 81-95% 100: 96%+ Bit 3: Has Ghosts Bit 4: Is IAM Bit 5: Is in Mixed Extent Bit 6: Is Allocated Each PFS page covers the next 8088 pages.

9 Page# 1 = PFS 2 = GAM 3 = SGAM 6 = DCM 7 = BCM Demo Time!

10 Query Memory Allocation
All Server Memory Allocated to SQL Server (sp_configure) Buffer Pool – data cache, plan cache, Query working memory Query memory target (75% of BPool)

11 Query Memory Allocation
Small Semaphore (Cost < 3, mem req < 5MB) High Query 1 Cost 35, Req. 25MB Medium Low High Large Semaphore (Everything else) Cost 1-9 Resource Semaphores (Memory grant queues) Available Query Memory Query 2 Cost 15, Req. 5MB Medium Low Query 2 Cost 15, Req. 5MB RESOURCE_SEMAPHORE Query 1 Cost 35, Req. 25MB High Cost 10-99 Medium Query 3 Cost 275, Req. 150MB Low Query 5 Cost 275, Req. 150MB Query 3 Cost 275, Req. 150MB High Cost Medium Low Query 4 Cost 2500, Req. 25MB Query 4 Cost 2500, Req. 25MB High Cost Medium Low Query 5 Cost 275, Req. 150MB High Cost 10000+ Medium Low

12 Thank you for attending!
Eddie Wuerch


Download ppt "A Day in the Life of a Row Eddie Wuerch, mcm"

Similar presentations


Ads by Google