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

Slides:



Advertisements
Similar presentations
Module 2: Database Architecture
Advertisements

SQL Server Storage Engine.  Software architect at Red Gate Software  Responsible for SQL tools: ◦ SQL Compare, SQL Data Compare, SQL Packager ◦ SQL.
CS4432: Database Systems II Buffer Manager 1. 2 Covered in week 1.
File Systems.
Page Footer Keed Education Oracle Database Administration Basic Copyright 2009 Keed Education BV Version Concept.
A HEAP OF CLUSTERS A look into heaps vs. clustered tables Ami Levin CTO, DBSophic X.
Microsoft SQL Server Administration for SAP SQL Server Architecture.
©UCB CS 161 Ch 7: Memory Hierarchy LECTURE 24 Instructor: L.N. Bhuyan
Working with SQL and PL/SQL/ Session 1 / 1 of 27 SQL Server Architecture.
Virtual Memory By: Dinouje Fahih. Definition of Virtual Memory Virtual memory is a concept that, allows a computer and its operating system, to use a.
Russ Houberg Senior Technical Architect, MCM KnowledgeLake, Inc.
Key Perf considerations & bottlenecks Windows Azure VM characteristics Monitoring TroubleshootingBest practices.
Oracle Database Architecture An Oracle server: –Is a database management system that provides an open, comprehensive, integrated approach to information.
Chapter Oracle Server An Oracle Server consists of an Oracle database (stored data, control and log files.) The Server will support SQL to define.
Data Recovery and Fixing Database Corruptions
Paging Examples Assume a page size of 1K and a 15-bit logical address space. How many pages are in the system?
CSE 781 – DATABASE MANAGEMENT SYSTEMS Introduction To Oracle 10g Rajika Tandon.
Databases Lesson 5.
Architecture Rajesh. Components of Database Engine.
DBI313. MetricOLTPDWLog Read/Write mixMostly reads, smaller # of rows at a time Scan intensive, large portions of data at a time, bulk loading Mostly.
IN-MEMORY OLTP By Manohar Punna SQL Server Geeks – Regional Mentor, Hyderabad Blogger, Speaker.
Introduction: Memory Management 2 Ideally programmers want memory that is large fast non volatile Memory hierarchy small amount of fast, expensive memory.
ICOM 6005 – Database Management Systems Design Dr. Manuel Rodríguez-Martínez Electrical and Computer Engineering Department Lecture 7 – Buffer Management.
TOP 10 Thinks you shouldn’t do with/in your database
Physical Database Structure .
Understanding the Data Page Structure Sathya Nekkanti Senior Manager/Database Architect.
Digging Out From Corruption Eddie Wuerch, MCM - Principal, Database Performance - Salesforce Marketing Cloud Data protection and loss recovery with SQL.
3 Copyright © 2004, Oracle. All rights reserved. Database Architecture Comparison.
Storage Tuning for Relational Databases Philippe Bonnet – Spring 2015.
SQL Server Internals 101 AYMAN SENIOR MICROSOFT.
Configuring SQL Server for a successful SharePoint Server Deployment Haaron Gonzalez Solution Architect & Consultant Microsoft MVP SharePoint Server
Making a Difference with Azure Storage Solutions Dudu Sinai.
Database Administration for the Non-DBA Denny Cherry twitter.com/mrdenny.
Oracle Database Architectural Components
Ayman El-Ghazali Senior Microsoft.
SQL Server Magic Buttons! What are Trace Flags and why should I care? Steinar Andersen, SQL Service Nordic AB Thanks to Thomas Kejser for peer-reviewing.
SQL Server Performance Tuning Starter Kit Randolph West | Born SQL.
SQL Server Storage Inside. About Hemantgiri S. Goswami Hemantgiri S. Goswami is a Lead Database Consultant for Pythian, a company head quartered in Ottawa,
Investigate TempDB Like Sherlock Holmes
SharePoint 2010 Performance and Capacity Planning Best Practices
What Is a Latch? …and Why Do I Care? Eddie Wuerch, mcm
What Is a Latch? …and Why Do I Care? Eddie Wuerch, mcm
Optimizing SQL Server and Databases for large Fact Tables
SharePoint Solutions Architect, Protiviti
SQL Server 2000 and Access 2000 limits
Finding more space for your tight environment
Database Management Systems (CS 564)
Chapter Overview Understanding the Database Architecture
Introduction to SQL Server Management for the Non-DBA
Hustle and Bustle of SQL Pages
Paging Examples Assume a page size of 1K and a 15-bit logical address space. How many pages are in the system?
Azure SQL Data Warehouse Scaling: Configuration and Guidance
Lecture 10: Buffer Manager and File Organization
SQL Server May Let You Do It, But it Doesn’t Mean You Should
The Vocabulary of Performance Tuning
The Vocabulary of Performance Tuning
Wellington, SQLSaturday#706
What Is a Latch? …and Why Do I Care? Eddie Wuerch, mcm
Microsoft SQL Server 2014 for Oracle DBAs Module 3
The Vocabulary of Performance Tuning
Optimizing SQL Server and Databases for large Fact Tables
It’s TEMPDB Why Should You Care?
The Vocabulary of Performance Tuning
Transaction Log Internals and Performance David M Maxwell
Статистика ожиданий или как найти место "где болит"
Hidden Gems of SQL Server 2014
Database administration
The Vocabulary of Performance Tuning
Index Structure for Files.
Hybrid Buffer Pool The Good, the Bad and the Ugly
Presentation transcript:

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

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

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

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)

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)

Bitmap Metadata Pages 8,096 bytes = 64,768 bits GAM, SGAM, BCM, DCM, IAM, …….. 96b Header 1101011000101010111010111… 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

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

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.

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

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)

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 100-999 Medium Low Query 4 Cost 2500, Req. 25MB Query 4 Cost 2500, Req. 25MB High Cost 1000-9999 Medium Low Query 5 Cost 275, Req. 150MB High Cost 10000+ Medium Low

Thank you for attending! Eddie Wuerch Twitter: @eddiew www.indydba.com