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 ApplicationsSteven Francia
 
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...Amazon Web Services
 
Lecture 40 1
Lecture 40 1Lecture 40 1
Lecture 40 1patib5
 
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 TajoDataWorks Summit
 
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 EMRAllice Shandler
 
Introduction to mongo db
Introduction to mongo dbIntroduction to mongo db
Introduction to mongo dbRohit Bishnoi
 
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 MattersDataWorks Summit
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDBJustin Smestad
 
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 DriverMongoDB
 
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 - AdvancedTony Rogerson
 
3 scenarios when to use MongoDB!
3 scenarios when to use MongoDB!3 scenarios when to use MongoDB!
3 scenarios when to use MongoDB!Edureka!
 
HBaseCon 2014-Just the Basics
HBaseCon 2014-Just the BasicsHBaseCon 2014-Just the Basics
HBaseCon 2014-Just the BasicsJesse Anderson
 
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 CassandraDataStax Academy
 
Scaling with MongoDB
Scaling with MongoDBScaling with MongoDB
Scaling with MongoDBRick Copeland
 
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 Cookbookguestae36d0
 
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 cacheMongoDB
 
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 tajoHyunsik 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

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 ServicesAmazon 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...Amazon Web Services
 
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 TalksAmazon Web Services
 
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 DayAmazon Web Services Korea
 
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...Amazon Web Services
 
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 endKnut Relbe-Moe [MVP, MCT]
 
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...Amazon Web Services
 
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)Amazon Web Services
 
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 2018Amazon Web Services
 
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 WarehouseAmazon Web Services
 
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 Amazon Web Services
 
Configuring workload-based storage and topologies
Configuring workload-based storage and topologiesConfiguring workload-based storage and topologies
Configuring workload-based storage and topologiesMariaDB plc
 
Optimize SQL server performance for SharePoint
Optimize SQL server performance for SharePointOptimize SQL server performance for SharePoint
Optimize SQL server performance for SharePointserge luca
 
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 RedshiftAmazon Web Services
 
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 ChefGaurav "GP" Pal
 
stackArmor presentation for DevOpsDC ver 4
stackArmor presentation for DevOpsDC ver 4stackArmor presentation for DevOpsDC ver 4
stackArmor presentation for DevOpsDC ver 4Gaurav "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

HIGH PERFORMANCE DATABASES
HIGH PERFORMANCE DATABASESHIGH PERFORMANCE DATABASES
HIGH PERFORMANCE DATABASESDAGEOP LTD
 
DBA – THINGS TO KNOW
DBA – THINGS TO KNOWDBA – THINGS TO KNOW
DBA – THINGS TO KNOWDAGEOP LTD
 
SQL Server Editions and Features
SQL Server Editions and Features SQL Server Editions and Features
SQL Server Editions and Features DAGEOP LTD
 
DATA & POWER VISUALIZATION
DATA & POWER VISUALIZATIONDATA & POWER VISUALIZATION
DATA & POWER VISUALIZATIONDAGEOP LTD
 
Microsoft Products
Microsoft ProductsMicrosoft Products
Microsoft ProductsDAGEOP LTD
 
Data, Education and Social awareness
Data, Education and Social awarenessData, Education and Social awareness
Data, Education and Social awarenessDAGEOP LTD
 
Data Modeling - Series 4 X-Events
Data Modeling - Series 4 X-EventsData Modeling - Series 4 X-Events
Data Modeling - Series 4 X-EventsDAGEOP LTD
 
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 dataDAGEOP LTD
 
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 IndexesDAGEOP LTD
 
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 typesDAGEOP LTD
 
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 ArchitectureDAGEOP LTD
 
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 managementDAGEOP LTD
 
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 ManagementDAGEOP LTD
 
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 indexesDAGEOP LTD
 
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 planDAGEOP LTD
 
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 AnalysisDAGEOP LTD
 
Advanced SSRS Reporting Techniques
Advanced SSRS Reporting TechniquesAdvanced SSRS Reporting Techniques
Advanced SSRS Reporting TechniquesDAGEOP LTD
 
Perfect Performance Platter - SQL Server 2014
Perfect Performance Platter - SQL Server 2014 Perfect Performance Platter - SQL Server 2014
Perfect Performance Platter - SQL Server 2014 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

Data-Analysis for Chicago Crime Data 2023
Data-Analysis for Chicago Crime Data  2023Data-Analysis for Chicago Crime Data  2023
Data-Analysis for Chicago Crime Data 2023ymrp368
 
Introduction-to-Machine-Learning (1).pptx
Introduction-to-Machine-Learning (1).pptxIntroduction-to-Machine-Learning (1).pptx
Introduction-to-Machine-Learning (1).pptxfirstjob4
 
Vip Model Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...
Vip Model  Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...Vip Model  Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...
Vip Model Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...shivangimorya083
 
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptxBPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptxMohammedJunaid861692
 
Schema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfSchema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfLars Albertsson
 
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% SecureCall me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% SecurePooja Nehwal
 
FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfMarinCaroMartnezBerg
 
Discover Why Less is More in B2B Research
Discover Why Less is More in B2B ResearchDiscover Why Less is More in B2B Research
Discover Why Less is More in B2B Researchmichael115558
 
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...Delhi Call girls
 
Log Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptxLog Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptxJohnnyPlasten
 
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 nightCheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 nightDelhi Call girls
 
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
 
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...amitlee9823
 
April 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's AnalysisApril 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's Analysismanisha194592
 
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort ServiceBDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort ServiceDelhi Call girls
 
Ravak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxRavak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxolyaivanovalion
 

Kürzlich hochgeladen (20)

Data-Analysis for Chicago Crime Data 2023
Data-Analysis for Chicago Crime Data  2023Data-Analysis for Chicago Crime Data  2023
Data-Analysis for Chicago Crime Data 2023
 
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get CytotecAbortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
 
Introduction-to-Machine-Learning (1).pptx
Introduction-to-Machine-Learning (1).pptxIntroduction-to-Machine-Learning (1).pptx
Introduction-to-Machine-Learning (1).pptx
 
Vip Model Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...
Vip Model  Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...Vip Model  Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...
Vip Model Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...
 
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptxBPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
 
Schema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfSchema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdf
 
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
 
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% SecureCall me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
 
FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdf
 
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts ServiceCall Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
 
Sampling (random) method and Non random.ppt
Sampling (random) method and Non random.pptSampling (random) method and Non random.ppt
Sampling (random) method and Non random.ppt
 
Discover Why Less is More in B2B Research
Discover Why Less is More in B2B ResearchDiscover Why Less is More in B2B Research
Discover Why Less is More in B2B Research
 
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
 
Log Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptxLog Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptx
 
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 nightCheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
 
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...
 
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
 
April 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's AnalysisApril 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's Analysis
 
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort ServiceBDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
 
Ravak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxRavak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptx
 

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