SlideShare ist ein Scribd-Unternehmen logo
1 von 30
www.dageop.com
All about
Storage
®
MS-02: Defining Data
DR. SUBRAMANI
PARAMASIVAM
(MANI)
About
me
Dr. SubraMANI Paramasivam
PhD., MCT, MCSE, MCITP, MCP, MCTS, MCSA
CEO, Principal Consultant & Trainer
@ DAGEOP (UK)
Email: mani@dageop.com
Blog: http://dataap.org/blog
Follow
Us
https://www.facebook.com/pages/YOUR-SQL-MAN-LTD/
http://www.youtube.com/user/YourSQLMAN
https://twitter.com/dageop
https://uk.linkedin.com/in/dageop
Proud Sponsor
• SQLBits
• SQL Saturdays
• MCT Summit
• SQL Server Geeks
Summit
• Data Awareness
Programme
• Dageop’s Data Day
®
www.DataAP.org
SPEAKER
Contents
MS-02: Defining Data
• Data & Data Types
• Text and Image Locations
• Page Structures & Internals
www.dageop.com
All About Storage
Data and Data types
www.dageop.com
All About Storage
Selecting the Correct Data Types
• Identify
• Data
• Data types
• Organize
• Categorize
• integer,
• Currency,
• Datetime,
• Geography,
• Money,
• Varchar,
• NVarchar
ID Name Age Sex Date_of_Joining Salary
1 Mark 42 M 04/08/2011 £55,000.00
2 Peter 32 M 10/03/2007 £48,000.00
3 Julie 36 F 11/11/2009 £49,000.00
Column_name Data_type Length
ID Integer
Name Varchar 10
Age Integer
Sex Char 2
Date_Of_Joining Datetime
Salary Money
www.dageop.com
All About Storage
Selecting the Correct Data Types
• Can’t store text in a numeric field.
• Reserves the storage space with the chosen datatype.
www.dageop.com
All About Storage
Selecting the Correct Data Types
Data Type Explanation
Character Alphanumeric Text
Example : A customer address
Currency Monetary Amounts
Example : The price of an item
Date Chronological data consisting of month,
day and year.
Example : Date of arrival
DateTime Chronological data consisting of month,
day, year, hours, minutes and seconds
Example : Date and Time of arrival
Data Type Explanation
Numeric Integers or Decimal numbers
Example : The quantity of Items Ordered
Double A double- precision floating point number
Example : Scientific Data requiring a high
degree of precision.
Float Same as Numeric
Integer Numeric Value With no decimals
Example: Line number in a order
Memo Alphanumeric text of indeterminate length
Example : Notes about a phone call in a
phone log
www.dageop.com
All About Storage
Selecting the Correct Data Types
Column_Name Datatype
BusinessID Integer
NationalIDNumber NVARCHAR()
LoginID NVARCHAR()
OrganizationNode NVARCHAR()
OrganizationLevel Integer
JobTitle NVARCHAR()
BirthDate Datetime
Marital Status Char
Column_Name Datatype
Gender Char
HireDate Datetime
SalariedFlag Bit
VacationHours Smallint
SickLeaveHours Smallint
CurrentFlag Bit
Rowguid Uniqueidentifier
ModifiedDate datetime
www.dageop.com
All About Storage
Selecting the Correct Data Types
Humanresource.Employee
www.dageop.com
All About Storage
DEMO
www.dageop.com
All About Storage
Text and Image Locations
www.dageop.com
All About Storage
Text and Image Locations
• SQL Server stores character strings more than 8k Characters and binary data more than 8k
bytes as special data types TEXT and IMAGE.
• The below scenario will help you to understand the use of TEXT and Image data type in
much deeper.
www.dageop.com
All About Storage
Text and Image Locations
• By default text and image values are not considered as part of the data row but as
collection of pages of their own.
• For single text and image column the data page contain 16 byte pointer which in turn will
point to the location of the initial page of the text or image data.
• The page that contains text and image data are also of 8kb size. A single text or image
page can hold text, ntext or image data from different columns and also from different
rows but from a single table. This supports minimizing the storage.
• A table contains text and image data in the database will have their own single set of
pages. The information about starting location of the collection of pages is stored in the
sysindexes system table.
• The text or image collection will have an index id of 255 always.
www.dageop.com
All About Storage
Text and Image Locations
text
ntext
Image
varchar(max)
nvarchar(max)
varbinary(max)
Decision:
• Filestream Vs Database
• <256KB = In DB
• >256KB = Filestream in hard drive
• Separate table for storing images.
• A separate FG is highly recommended
REPLACE
www.dageop.com
All About Storage
Text and Image Locations
DATATYPE SIZE
Database <256KB
Filestream in a location >256KB
Varbinary(max) maximum size of 2 GB.
Varbinary(max) with Filestream option images larger than 2 GB
www.dageop.com
All About Storage
Text and Image Locations
Read Throughput After Bulk load
0
2
4
6
8
10
12
256K 512K 1M
Object Size
MB/sec
Database
Filesystem
Databases are fastest on small
objects. As object size increases,
NTFS throughput improves faster
than SQL Server throughput.
Read Throughput After Two Overwrites
0
2
4
6
8
10
12
256K 512K 1M
Object Size
MB/sec
Database
Filesystem
Read Throughput After Four Overwrites
0
1
2
3
4
5
6
7
8
9
10
256K 512K 1M
Object Size
MB/sec
Database
Filesystem
Fragmentation causes read performance to degrade over time.
The filesystem is less affected by this than SQL Server. Over
time NTFS outperforms SQL Server when objects are larger
than 256KB.
Credit: Microsoft Research Paper by Russell Sears, Catharine Van Ingen, and Jim Gray, 2006
www.dageop.com
All About Storage
Text and Image Locations
• Text and Image information is presented externally to user as a lengthy string of bytes but
internally the information is stored within a set of pages.
• The pages are not organized sequentially but are logically organized as a B tree Structure
• If any operation addresses to find any data in the middle of the B TREE Structure, the operation can be easily diverted to
the exact page instead of going to the page in sequential manner.
B TREE Structure
www.dageop.com
All About Storage
DEMO
www.dageop.com
All About Storage
Page Structures & Internals
www.dageop.com
All About Storage
Page Structures & Internals
• 8kb per page is the basic unit of IO.
• Allocation units GAM, SGAM.
• Types of pages to store variety of data like data, index, BLOB etc.
• Three sections Page Header, Actual data and Row offset array
HEADER
ROW 1
ROW 2
ROW 3
ROW 4
3 2 14
Empty space to be
used
Row Offset
www.dageop.com
All About Storage
Page Structures & Internals
• Pages allocated to a table can be viewed with undocumented DBCC IND Command
• Page type 10 (IAM page With Page ID 154) and 1 (data page and the page id is 153).
www.dageop.com
All About Storage
Page Structures & Internals
• Page Type – The Type of Page
• 1 – Datapage
• 2 – Index Page
• 3 & 4 - Text page
• 8 – GAM Page
• 9 – SGAM Page
• 10 –IAM page
• 11- PFS Page
Description of columns displayed from DBCC IND
PageFID File ID of Page
PagePID Page ID
IAMFID,IAMPID File ID & Page ID -> IAM mapping
ObjectID object ID(Table)
IndexID Clustered index (IndexID = 1), Non clustered index (IndexID = 2)
PartitionNumber Number of Partition which holds data & index pages
PartitionID ID of Partition which holds data & index pages
iam_chain_type In-row data,Row-Overflow data
PageType 1=Data page,2=Index page,3&4=Text page,10=IAM
IndexLevel 0=leaf level
NextPageFID,NextPagePID,PrevPageFID,P
revPagePID Next & Previous Page ID 's & File ID 's of a page
www.dageop.com
All About Storage
Page Structures & Internals
• Index Level – What level the page is in INDEX
• Next Page FID and Next Page PID – The Page ID of the next page
• Prev Page FID and Prev Page PID - The Page ID of the Previous page
• Now let us examine the row data stored in the page.
DBCC TRACEON (3604); -- By default the output is sent to error log
DBCC PAGE ()
• 4 levels of output
1. Buffer (about memory allocation)
www.dageop.com
All About Storage
Page Structures & Internals
2. Page header - having 96 byte of size and same for all the pages
www.dageop.com
All About Storage
Page Structures & Internals
3. Slot section - Each records are stored in a slot. Slot 0 will have the first record in the first page and slot 1 will have
second record and so on, but there is no mandatory that the slots should be in physical order of data.
www.dageop.com
All About Storage
Page Structures & Internals
4. Row offset table and the code should be executed with option number 1 for offset table
DBCC PAGE (‘Database’, 1, pagenumber, 1)
www.dageop.com
All About Storage
DEMO
www.dageop.com
All About Storage
Review
Data And Data Types
Choosing The Correct Data Type
Text And Image Location
Text and Image Data Requirement and storage
Page structures & Internals
Page
Anatomy of Page
www.dageop.com
All About Storage
Q & A
www.dageop.com
All About Storage
®
www.dageop.com

Weitere ähnliche Inhalte

Was ist angesagt?

Hybrid MongoDB and RDBMS Applications
Hybrid MongoDB and RDBMS ApplicationsHybrid MongoDB and RDBMS Applications
Hybrid MongoDB and RDBMS Applications
Steven Francia
 
Efficient In-situ Processing of Various Storage Types on Apache Tajo
Efficient In-situ Processing of Various Storage Types on Apache TajoEfficient In-situ Processing of Various Storage Types on Apache Tajo
Efficient In-situ Processing of Various Storage Types on Apache Tajo
DataWorks Summit
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
Justin Smestad
 
U C2007 My S Q L Performance Cookbook
U C2007  My S Q L  Performance  CookbookU C2007  My S Q L  Performance  Cookbook
U C2007 My S Q L Performance Cookbook
guestae36d0
 
Efficient in situ processing of various storage types on apache tajo
Efficient in situ processing of various storage types on apache tajoEfficient in situ processing of various storage types on apache tajo
Efficient in situ processing of various storage types on apache tajo
Hyunsik Choi
 

Was ist angesagt? (20)

Hybrid MongoDB and RDBMS Applications
Hybrid MongoDB and RDBMS ApplicationsHybrid MongoDB and RDBMS Applications
Hybrid MongoDB and RDBMS Applications
 
23 October 2013 - AWS 201 - A Walk through the AWS Cloud: Introduction to Ama...
23 October 2013 - AWS 201 - A Walk through the AWS Cloud: Introduction to Ama...23 October 2013 - AWS 201 - A Walk through the AWS Cloud: Introduction to Ama...
23 October 2013 - AWS 201 - A Walk through the AWS Cloud: Introduction to Ama...
 
Lecture 40 1
Lecture 40 1Lecture 40 1
Lecture 40 1
 
Efficient In-situ Processing of Various Storage Types on Apache Tajo
Efficient In-situ Processing of Various Storage Types on Apache TajoEfficient In-situ Processing of Various Storage Types on Apache Tajo
Efficient In-situ Processing of Various Storage Types on Apache Tajo
 
Vancouver AWS Meetup Slides 11-20-2018 Apache Spark with Amazon EMR
Vancouver AWS Meetup Slides 11-20-2018 Apache Spark with Amazon EMRVancouver AWS Meetup Slides 11-20-2018 Apache Spark with Amazon EMR
Vancouver AWS Meetup Slides 11-20-2018 Apache Spark with Amazon EMR
 
Introduction to mongo db
Introduction to mongo dbIntroduction to mongo db
Introduction to mongo db
 
Mysql using php
Mysql using phpMysql using php
Mysql using php
 
Millions of Regions in HBase: Size Matters
Millions of Regions in HBase: Size MattersMillions of Regions in HBase: Size Matters
Millions of Regions in HBase: Size Matters
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
Mongo db dhruba
Mongo db dhrubaMongo db dhruba
Mongo db dhruba
 
Webinar: What's new in the .NET Driver
Webinar: What's new in the .NET DriverWebinar: What's new in the .NET Driver
Webinar: What's new in the .NET Driver
 
SQL Server 2014 Memory Optimised Tables - Advanced
SQL Server 2014 Memory Optimised Tables - AdvancedSQL Server 2014 Memory Optimised Tables - Advanced
SQL Server 2014 Memory Optimised Tables - Advanced
 
3 scenarios when to use MongoDB!
3 scenarios when to use MongoDB!3 scenarios when to use MongoDB!
3 scenarios when to use MongoDB!
 
HBaseCon 2014-Just the Basics
HBaseCon 2014-Just the BasicsHBaseCon 2014-Just the Basics
HBaseCon 2014-Just the Basics
 
Cassandra Day Atlanta 2015: Feeding Solr at Large Scale with Apache Cassandra
Cassandra Day Atlanta 2015: Feeding Solr at Large Scale with Apache CassandraCassandra Day Atlanta 2015: Feeding Solr at Large Scale with Apache Cassandra
Cassandra Day Atlanta 2015: Feeding Solr at Large Scale with Apache Cassandra
 
Scaling with MongoDB
Scaling with MongoDBScaling with MongoDB
Scaling with MongoDB
 
U C2007 My S Q L Performance Cookbook
U C2007  My S Q L  Performance  CookbookU C2007  My S Q L  Performance  Cookbook
U C2007 My S Q L Performance Cookbook
 
Postgresql tutorial
Postgresql tutorialPostgresql tutorial
Postgresql tutorial
 
MongoDB as a fast and queryable cache
MongoDB as a fast and queryable cacheMongoDB as a fast and queryable cache
MongoDB as a fast and queryable cache
 
Efficient in situ processing of various storage types on apache tajo
Efficient in situ processing of various storage types on apache tajoEfficient in situ processing of various storage types on apache tajo
Efficient in situ processing of various storage types on apache tajo
 

Ähnlich wie All about Storage - Series 2 Defining Data

stackArmor presentation for DevOpsDC ver 4
stackArmor presentation for DevOpsDC ver 4stackArmor presentation for DevOpsDC ver 4
stackArmor presentation for DevOpsDC ver 4
Gaurav "GP" Pal
 
Maaz Anjum - IOUG Collaborate 2013 - An Insight into Space Realization on ODA...
Maaz Anjum - IOUG Collaborate 2013 - An Insight into Space Realization on ODA...Maaz Anjum - IOUG Collaborate 2013 - An Insight into Space Realization on ODA...
Maaz Anjum - IOUG Collaborate 2013 - An Insight into Space Realization on ODA...
Maaz Anjum
 

Ähnlich wie All about Storage - Series 2 Defining Data (20)

SQLServer Database Structures
SQLServer Database Structures SQLServer Database Structures
SQLServer Database Structures
 
AWS March 2016 Webinar Series - Managed Database Services on Amazon Web Services
AWS March 2016 Webinar Series - Managed Database Services on Amazon Web ServicesAWS March 2016 Webinar Series - Managed Database Services on Amazon Web Services
AWS March 2016 Webinar Series - Managed Database Services on Amazon Web Services
 
Getting Started with Managed Database Services on AWS - September 2016 Webina...
Getting Started with Managed Database Services on AWS - September 2016 Webina...Getting Started with Managed Database Services on AWS - September 2016 Webina...
Getting Started with Managed Database Services on AWS - September 2016 Webina...
 
Selecting the Right AWS Database Solution - AWS 2017 Online Tech Talks
Selecting the Right AWS Database Solution - AWS 2017 Online Tech TalksSelecting the Right AWS Database Solution - AWS 2017 Online Tech Talks
Selecting the Right AWS Database Solution - AWS 2017 Online Tech Talks
 
week1slides1704202828322.pdf
week1slides1704202828322.pdfweek1slides1704202828322.pdf
week1slides1704202828322.pdf
 
Choosing the Right Database Service (김상필, 유타카 호시노) - AWS DB Day
Choosing the Right Database Service (김상필, 유타카 호시노) - AWS DB DayChoosing the Right Database Service (김상필, 유타카 호시노) - AWS DB Day
Choosing the Right Database Service (김상필, 유타카 호시노) - AWS DB Day
 
AWS re:Invent 2016| DAT318 | Migrating from RDBMS to NoSQL: How Sony Moved fr...
AWS re:Invent 2016| DAT318 | Migrating from RDBMS to NoSQL: How Sony Moved fr...AWS re:Invent 2016| DAT318 | Migrating from RDBMS to NoSQL: How Sony Moved fr...
AWS re:Invent 2016| DAT318 | Migrating from RDBMS to NoSQL: How Sony Moved fr...
 
SPSMadrid Get sql spinning with SharePoint. Best practice for the back end
SPSMadrid Get sql spinning with SharePoint. Best practice for the back endSPSMadrid Get sql spinning with SharePoint. Best practice for the back end
SPSMadrid Get sql spinning with SharePoint. Best practice for the back end
 
AWS Public Data Sets: How to Stage Petabytes of Data for Analysis in AWS (WPS...
AWS Public Data Sets: How to Stage Petabytes of Data for Analysis in AWS (WPS...AWS Public Data Sets: How to Stage Petabytes of Data for Analysis in AWS (WPS...
AWS Public Data Sets: How to Stage Petabytes of Data for Analysis in AWS (WPS...
 
AWS Summit London 2014 | Uses and Best Practices for Amazon Redshift (200)
AWS Summit London 2014 | Uses and Best Practices for Amazon Redshift (200)AWS Summit London 2014 | Uses and Best Practices for Amazon Redshift (200)
AWS Summit London 2014 | Uses and Best Practices for Amazon Redshift (200)
 
Module 4 - AWSome Day Online Conference 2018
Module 4 - AWSome Day Online Conference 2018Module 4 - AWSome Day Online Conference 2018
Module 4 - AWSome Day Online Conference 2018
 
Leveraging Amazon Redshift for Your Data Warehouse
Leveraging Amazon Redshift for Your Data WarehouseLeveraging Amazon Redshift for Your Data Warehouse
Leveraging Amazon Redshift for Your Data Warehouse
 
Oracle DB
Oracle DBOracle DB
Oracle DB
 
Uses and Best Practices for Amazon Redshift
Uses and Best Practices for Amazon Redshift Uses and Best Practices for Amazon Redshift
Uses and Best Practices for Amazon Redshift
 
Configuring workload-based storage and topologies
Configuring workload-based storage and topologiesConfiguring workload-based storage and topologies
Configuring workload-based storage and topologies
 
Optimize SQL server performance for SharePoint
Optimize SQL server performance for SharePointOptimize SQL server performance for SharePoint
Optimize SQL server performance for SharePoint
 
Building Your Data Warehouse with Amazon Redshift
Building Your Data Warehouse with Amazon RedshiftBuilding Your Data Warehouse with Amazon Redshift
Building Your Data Warehouse with Amazon Redshift
 
DevOps for ETL processing at scale with MongoDB, Solr, AWS and Chef
DevOps for ETL processing at scale with MongoDB, Solr, AWS and ChefDevOps for ETL processing at scale with MongoDB, Solr, AWS and Chef
DevOps for ETL processing at scale with MongoDB, Solr, AWS and Chef
 
stackArmor presentation for DevOpsDC ver 4
stackArmor presentation for DevOpsDC ver 4stackArmor presentation for DevOpsDC ver 4
stackArmor presentation for DevOpsDC ver 4
 
Maaz Anjum - IOUG Collaborate 2013 - An Insight into Space Realization on ODA...
Maaz Anjum - IOUG Collaborate 2013 - An Insight into Space Realization on ODA...Maaz Anjum - IOUG Collaborate 2013 - An Insight into Space Realization on ODA...
Maaz Anjum - IOUG Collaborate 2013 - An Insight into Space Realization on ODA...
 

Mehr von DAGEOP LTD

Mehr von DAGEOP LTD (18)

HIGH PERFORMANCE DATABASES
HIGH PERFORMANCE DATABASESHIGH PERFORMANCE DATABASES
HIGH PERFORMANCE DATABASES
 
DBA – THINGS TO KNOW
DBA – THINGS TO KNOWDBA – THINGS TO KNOW
DBA – THINGS TO KNOW
 
SQL Server Editions and Features
SQL Server Editions and Features SQL Server Editions and Features
SQL Server Editions and Features
 
DATA & POWER VISUALIZATION
DATA & POWER VISUALIZATIONDATA & POWER VISUALIZATION
DATA & POWER VISUALIZATION
 
Microsoft Products
Microsoft ProductsMicrosoft Products
Microsoft Products
 
Data, Education and Social awareness
Data, Education and Social awarenessData, Education and Social awareness
Data, Education and Social awareness
 
Data Modeling - Series 4 X-Events
Data Modeling - Series 4 X-EventsData Modeling - Series 4 X-Events
Data Modeling - Series 4 X-Events
 
Data Modeling - Series 1 Storing summarised data
Data Modeling - Series 1 Storing summarised dataData Modeling - Series 1 Storing summarised data
Data Modeling - Series 1 Storing summarised data
 
Optimising Queries - Series 4 Designing Effective Indexes
Optimising Queries - Series 4 Designing Effective IndexesOptimising Queries - Series 4 Designing Effective Indexes
Optimising Queries - Series 4 Designing Effective Indexes
 
Optimising Queries - Series 3 Distinguishing among query types
Optimising Queries - Series 3 Distinguishing among query typesOptimising Queries - Series 3 Distinguishing among query types
Optimising Queries - Series 3 Distinguishing among query types
 
Optimising Queries - Series 1 Query Optimiser Architecture
Optimising Queries - Series 1 Query Optimiser ArchitectureOptimising Queries - Series 1 Query Optimiser Architecture
Optimising Queries - Series 1 Query Optimiser Architecture
 
Managing Memory & Locks - Series 2 Transactions & Lock management
Managing  Memory & Locks - Series 2 Transactions & Lock managementManaging  Memory & Locks - Series 2 Transactions & Lock management
Managing Memory & Locks - Series 2 Transactions & Lock management
 
Managing Memory & Locks - Series 1 Memory Management
Managing  Memory & Locks - Series 1 Memory ManagementManaging  Memory & Locks - Series 1 Memory Management
Managing Memory & Locks - Series 1 Memory Management
 
All about Storage - Series 3 - All about indexes
All about Storage - Series 3 - All about indexesAll about Storage - Series 3 - All about indexes
All about Storage - Series 3 - All about indexes
 
Database Fundamental Concepts - Series 2 Monitoring plan
Database Fundamental Concepts - Series 2 Monitoring planDatabase Fundamental Concepts - Series 2 Monitoring plan
Database Fundamental Concepts - Series 2 Monitoring plan
 
Database Fundamental Concepts- Series 1 - Performance Analysis
Database Fundamental Concepts- Series 1 - Performance AnalysisDatabase Fundamental Concepts- Series 1 - Performance Analysis
Database Fundamental Concepts- Series 1 - Performance Analysis
 
Advanced SSRS Reporting Techniques
Advanced SSRS Reporting TechniquesAdvanced SSRS Reporting Techniques
Advanced SSRS Reporting Techniques
 
Perfect Performance Platter - SQL Server 2014
Perfect Performance Platter - SQL Server 2014 Perfect Performance Platter - SQL Server 2014
Perfect Performance Platter - SQL Server 2014
 

Kürzlich hochgeladen

Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
amitlee9823
 
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night StandCall Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
amitlee9823
 
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
amitlee9823
 
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
amitlee9823
 
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men 🔝malwa🔝 Escorts Ser...
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men  🔝malwa🔝   Escorts Ser...➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men  🔝malwa🔝   Escorts Ser...
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men 🔝malwa🔝 Escorts Ser...
amitlee9823
 
Call Girls In Nandini Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Nandini Layout ☎ 7737669865 🥵 Book Your One night StandCall Girls In Nandini Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Nandini Layout ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night StandCall Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 
➥🔝 7737669865 🔝▻ Dindigul Call-girls in Women Seeking Men 🔝Dindigul🔝 Escor...
➥🔝 7737669865 🔝▻ Dindigul Call-girls in Women Seeking Men  🔝Dindigul🔝   Escor...➥🔝 7737669865 🔝▻ Dindigul Call-girls in Women Seeking Men  🔝Dindigul🔝   Escor...
➥🔝 7737669865 🔝▻ Dindigul Call-girls in Women Seeking Men 🔝Dindigul🔝 Escor...
amitlee9823
 
Just Call Vip call girls kakinada Escorts ☎️9352988975 Two shot with one girl...
Just Call Vip call girls kakinada Escorts ☎️9352988975 Two shot with one girl...Just Call Vip call girls kakinada Escorts ☎️9352988975 Two shot with one girl...
Just Call Vip call girls kakinada Escorts ☎️9352988975 Two shot with one girl...
gajnagarg
 
Just Call Vip call girls Bellary Escorts ☎️9352988975 Two shot with one girl ...
Just Call Vip call girls Bellary Escorts ☎️9352988975 Two shot with one girl ...Just Call Vip call girls Bellary Escorts ☎️9352988975 Two shot with one girl ...
Just Call Vip call girls Bellary Escorts ☎️9352988975 Two shot with one girl ...
gajnagarg
 
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
only4webmaster01
 
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
amitlee9823
 
Abortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get CytotecAbortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Riyadh +966572737505 get cytotec
 

Kürzlich hochgeladen (20)

Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
 
DATA SUMMIT 24 Building Real-Time Pipelines With FLaNK
DATA SUMMIT 24  Building Real-Time Pipelines With FLaNKDATA SUMMIT 24  Building Real-Time Pipelines With FLaNK
DATA SUMMIT 24 Building Real-Time Pipelines With FLaNK
 
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night StandCall Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
 
Anomaly detection and data imputation within time series
Anomaly detection and data imputation within time seriesAnomaly detection and data imputation within time series
Anomaly detection and data imputation within time series
 
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
 
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
 
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
 
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
 
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
 
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men 🔝malwa🔝 Escorts Ser...
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men  🔝malwa🔝   Escorts Ser...➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men  🔝malwa🔝   Escorts Ser...
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men 🔝malwa🔝 Escorts Ser...
 
Call Girls In Nandini Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Nandini Layout ☎ 7737669865 🥵 Book Your One night StandCall Girls In Nandini Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Nandini Layout ☎ 7737669865 🥵 Book Your One night Stand
 
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night StandCall Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
 
➥🔝 7737669865 🔝▻ Dindigul Call-girls in Women Seeking Men 🔝Dindigul🔝 Escor...
➥🔝 7737669865 🔝▻ Dindigul Call-girls in Women Seeking Men  🔝Dindigul🔝   Escor...➥🔝 7737669865 🔝▻ Dindigul Call-girls in Women Seeking Men  🔝Dindigul🔝   Escor...
➥🔝 7737669865 🔝▻ Dindigul Call-girls in Women Seeking Men 🔝Dindigul🔝 Escor...
 
Just Call Vip call girls kakinada Escorts ☎️9352988975 Two shot with one girl...
Just Call Vip call girls kakinada Escorts ☎️9352988975 Two shot with one girl...Just Call Vip call girls kakinada Escorts ☎️9352988975 Two shot with one girl...
Just Call Vip call girls kakinada Escorts ☎️9352988975 Two shot with one girl...
 
Just Call Vip call girls Bellary Escorts ☎️9352988975 Two shot with one girl ...
Just Call Vip call girls Bellary Escorts ☎️9352988975 Two shot with one girl ...Just Call Vip call girls Bellary Escorts ☎️9352988975 Two shot with one girl ...
Just Call Vip call girls Bellary Escorts ☎️9352988975 Two shot with one girl ...
 
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
 
Aspirational Block Program Block Syaldey District - Almora
Aspirational Block Program Block Syaldey District - AlmoraAspirational Block Program Block Syaldey District - Almora
Aspirational Block Program Block Syaldey District - Almora
 
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
 
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
 
Abortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get CytotecAbortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get Cytotec
 

All about Storage - Series 2 Defining Data

  • 1. www.dageop.com All about Storage ® MS-02: Defining Data DR. SUBRAMANI PARAMASIVAM (MANI)
  • 2. About me Dr. SubraMANI Paramasivam PhD., MCT, MCSE, MCITP, MCP, MCTS, MCSA CEO, Principal Consultant & Trainer @ DAGEOP (UK) Email: mani@dageop.com Blog: http://dataap.org/blog Follow Us https://www.facebook.com/pages/YOUR-SQL-MAN-LTD/ http://www.youtube.com/user/YourSQLMAN https://twitter.com/dageop https://uk.linkedin.com/in/dageop Proud Sponsor • SQLBits • SQL Saturdays • MCT Summit • SQL Server Geeks Summit • Data Awareness Programme • Dageop’s Data Day ® www.DataAP.org SPEAKER
  • 3. Contents MS-02: Defining Data • Data & Data Types • Text and Image Locations • Page Structures & Internals www.dageop.com All About Storage
  • 4. Data and Data types www.dageop.com All About Storage
  • 5. Selecting the Correct Data Types • Identify • Data • Data types • Organize • Categorize • integer, • Currency, • Datetime, • Geography, • Money, • Varchar, • NVarchar ID Name Age Sex Date_of_Joining Salary 1 Mark 42 M 04/08/2011 £55,000.00 2 Peter 32 M 10/03/2007 £48,000.00 3 Julie 36 F 11/11/2009 £49,000.00 Column_name Data_type Length ID Integer Name Varchar 10 Age Integer Sex Char 2 Date_Of_Joining Datetime Salary Money www.dageop.com All About Storage
  • 6. Selecting the Correct Data Types • Can’t store text in a numeric field. • Reserves the storage space with the chosen datatype. www.dageop.com All About Storage
  • 7. Selecting the Correct Data Types Data Type Explanation Character Alphanumeric Text Example : A customer address Currency Monetary Amounts Example : The price of an item Date Chronological data consisting of month, day and year. Example : Date of arrival DateTime Chronological data consisting of month, day, year, hours, minutes and seconds Example : Date and Time of arrival Data Type Explanation Numeric Integers or Decimal numbers Example : The quantity of Items Ordered Double A double- precision floating point number Example : Scientific Data requiring a high degree of precision. Float Same as Numeric Integer Numeric Value With no decimals Example: Line number in a order Memo Alphanumeric text of indeterminate length Example : Notes about a phone call in a phone log www.dageop.com All About Storage
  • 8. Selecting the Correct Data Types Column_Name Datatype BusinessID Integer NationalIDNumber NVARCHAR() LoginID NVARCHAR() OrganizationNode NVARCHAR() OrganizationLevel Integer JobTitle NVARCHAR() BirthDate Datetime Marital Status Char Column_Name Datatype Gender Char HireDate Datetime SalariedFlag Bit VacationHours Smallint SickLeaveHours Smallint CurrentFlag Bit Rowguid Uniqueidentifier ModifiedDate datetime www.dageop.com All About Storage
  • 9. Selecting the Correct Data Types Humanresource.Employee www.dageop.com All About Storage
  • 11. Text and Image Locations www.dageop.com All About Storage
  • 12. Text and Image Locations • SQL Server stores character strings more than 8k Characters and binary data more than 8k bytes as special data types TEXT and IMAGE. • The below scenario will help you to understand the use of TEXT and Image data type in much deeper. www.dageop.com All About Storage
  • 13. Text and Image Locations • By default text and image values are not considered as part of the data row but as collection of pages of their own. • For single text and image column the data page contain 16 byte pointer which in turn will point to the location of the initial page of the text or image data. • The page that contains text and image data are also of 8kb size. A single text or image page can hold text, ntext or image data from different columns and also from different rows but from a single table. This supports minimizing the storage. • A table contains text and image data in the database will have their own single set of pages. The information about starting location of the collection of pages is stored in the sysindexes system table. • The text or image collection will have an index id of 255 always. www.dageop.com All About Storage
  • 14. Text and Image Locations text ntext Image varchar(max) nvarchar(max) varbinary(max) Decision: • Filestream Vs Database • <256KB = In DB • >256KB = Filestream in hard drive • Separate table for storing images. • A separate FG is highly recommended REPLACE www.dageop.com All About Storage
  • 15. Text and Image Locations DATATYPE SIZE Database <256KB Filestream in a location >256KB Varbinary(max) maximum size of 2 GB. Varbinary(max) with Filestream option images larger than 2 GB www.dageop.com All About Storage
  • 16. Text and Image Locations Read Throughput After Bulk load 0 2 4 6 8 10 12 256K 512K 1M Object Size MB/sec Database Filesystem Databases are fastest on small objects. As object size increases, NTFS throughput improves faster than SQL Server throughput. Read Throughput After Two Overwrites 0 2 4 6 8 10 12 256K 512K 1M Object Size MB/sec Database Filesystem Read Throughput After Four Overwrites 0 1 2 3 4 5 6 7 8 9 10 256K 512K 1M Object Size MB/sec Database Filesystem Fragmentation causes read performance to degrade over time. The filesystem is less affected by this than SQL Server. Over time NTFS outperforms SQL Server when objects are larger than 256KB. Credit: Microsoft Research Paper by Russell Sears, Catharine Van Ingen, and Jim Gray, 2006 www.dageop.com All About Storage
  • 17. Text and Image Locations • Text and Image information is presented externally to user as a lengthy string of bytes but internally the information is stored within a set of pages. • The pages are not organized sequentially but are logically organized as a B tree Structure • If any operation addresses to find any data in the middle of the B TREE Structure, the operation can be easily diverted to the exact page instead of going to the page in sequential manner. B TREE Structure www.dageop.com All About Storage
  • 19. Page Structures & Internals www.dageop.com All About Storage
  • 20. Page Structures & Internals • 8kb per page is the basic unit of IO. • Allocation units GAM, SGAM. • Types of pages to store variety of data like data, index, BLOB etc. • Three sections Page Header, Actual data and Row offset array HEADER ROW 1 ROW 2 ROW 3 ROW 4 3 2 14 Empty space to be used Row Offset www.dageop.com All About Storage
  • 21. Page Structures & Internals • Pages allocated to a table can be viewed with undocumented DBCC IND Command • Page type 10 (IAM page With Page ID 154) and 1 (data page and the page id is 153). www.dageop.com All About Storage
  • 22. Page Structures & Internals • Page Type – The Type of Page • 1 – Datapage • 2 – Index Page • 3 & 4 - Text page • 8 – GAM Page • 9 – SGAM Page • 10 –IAM page • 11- PFS Page Description of columns displayed from DBCC IND PageFID File ID of Page PagePID Page ID IAMFID,IAMPID File ID & Page ID -> IAM mapping ObjectID object ID(Table) IndexID Clustered index (IndexID = 1), Non clustered index (IndexID = 2) PartitionNumber Number of Partition which holds data & index pages PartitionID ID of Partition which holds data & index pages iam_chain_type In-row data,Row-Overflow data PageType 1=Data page,2=Index page,3&4=Text page,10=IAM IndexLevel 0=leaf level NextPageFID,NextPagePID,PrevPageFID,P revPagePID Next & Previous Page ID 's & File ID 's of a page www.dageop.com All About Storage
  • 23. Page Structures & Internals • Index Level – What level the page is in INDEX • Next Page FID and Next Page PID – The Page ID of the next page • Prev Page FID and Prev Page PID - The Page ID of the Previous page • Now let us examine the row data stored in the page. DBCC TRACEON (3604); -- By default the output is sent to error log DBCC PAGE () • 4 levels of output 1. Buffer (about memory allocation) www.dageop.com All About Storage
  • 24. Page Structures & Internals 2. Page header - having 96 byte of size and same for all the pages www.dageop.com All About Storage
  • 25. Page Structures & Internals 3. Slot section - Each records are stored in a slot. Slot 0 will have the first record in the first page and slot 1 will have second record and so on, but there is no mandatory that the slots should be in physical order of data. www.dageop.com All About Storage
  • 26. Page Structures & Internals 4. Row offset table and the code should be executed with option number 1 for offset table DBCC PAGE (‘Database’, 1, pagenumber, 1) www.dageop.com All About Storage
  • 28. Review Data And Data Types Choosing The Correct Data Type Text And Image Location Text and Image Data Requirement and storage Page structures & Internals Page Anatomy of Page www.dageop.com All About Storage
  • 29. Q & A www.dageop.com All About Storage