+ All Categories
Home > Technology > Random thoughts on... data bloat

Random thoughts on... data bloat

Date post: 14-Feb-2017
Category:
Upload: nigel-foulkes-nock
View: 24 times
Download: 2 times
Share this document with a friend
14
SQL Server the “Lean” way Random Thoughts on… DataBloat Nigel Foulkes-Nock February 2016 Confidential
Transcript

SQL Server the “Lean” wayRandom Thoughts on… DataBloat

Nigel Foulkes-NockFebruary 2016

Confidential

Confidential 29th January 2016 2

You don’t always notice it straight away…

Confidential 29th January 2016 3

A Table can become very large

Confidential 29th January 2016 4

Disk usage by Top Tables

Confidential 29th January 2016 5

Examples of Inappropriate DataTypes – page 1 of 2

Integer Datatype

ColumnName Example Datatype Range Bytes Suggestion Bytes

LoanDuration 24 INT +- 2,147,483,648 4SMALLINT 2

PartitionMonth 7INT +- 2,147,483,648 4TINYINT 1

Numeric Datatype

ColumnName Example Datatype Range Bytes Suggestion Bytes

LoanAmount 16000NUMERIC(18,2) precision 10-19 9… (9,2) 5

UnitCost 12999NUMERIC(18,2) precision 10-19 9… (9,2) 5

Confidential 29th January 2016 6

Examples of Inappropriate DataTypes – page 2 of 2

Date Datatype

ColumnName Example Datatype Range Bytes Suggestion Bytes

ApplicationDate DateTime1753-01-01 00:00:00.000 - 9999-12-31 00:00:00.000 4SMALL DATETIME 2

DateOfBirth 19991103DateTime1753-01-01 00:00:00.000 - 9999-12-31 00:00:00.000 8DATE 3

Character Datatypes

ColumnName Example Datatype Range Bytes Suggestion Bytes

MonthName January NCHAR(50)A-Z plus Unicode variance values 100VARCHAR(10) 10

Confidential 29th January 2016 7

SQL Server is just one large Data cache

Confidential 29th January 2016 8

Smaller Data size, less Data CacheingFaster, smarter, more efficient

Confidential 29th January 2016 9

Everything becomes more agile - Happy Data, Happy you

Confidential 29th January 2016 10

Identifying the Issue – Check your tablessp_help ‘schemaname.tablename’

e.g.

sp_help ‘dbo.TableAdmin’

sp_spaceused ‘schemaname.tablename’

Confidential 29th January 2016 11

References

http://www.techrepublic.com/blog/10-things/10-plus-common-questions-about-sql-server-data-types/

http://www.connectionstrings.com/sql-server-data-types-reference/

Confidential 29th January 2016 12

http://www.connectionstrings.com/sql-server-data-types-reference/

FIN

Confidential

Confidential 29th January 2016 14

Out-takes (removed slide)


Recommended