vladguzman@outlook.com
/in/vladguzman
Particionamiento y Compresión de
Datos en SQL Server 2016
Particionamiento
¿Qué es Particionamiento de tablas en BD?
Es el proceso donde tablas
muy grandes son divididas
en múltiples partes más
pequeñas.
El objetivo principal es
ayudar en el mantenimiento
de tablas grandes y reducir
el tiempo de respuesta
general para leer y cargar
datos
¿Por qué debe usarse?
• Para tener un mayor control de las subsecciones de datos.
Express with
Feature Enterprise Standard Web Advanced Express
Services
Data
x x x x x
compression
Partition Function
CREATE PARTITION FUNCTION PFPartitionByYear (DATE)
Min - 2013-12-31
2014-01-01 - 2014-12-31
2015-01-01 - 2015-12-31
2016-01-01 - Max
Partition Function
CREATE PARTITION FUNCTION PFPartitionByYear (DATE)
Min - 2014-01-01
2014-01-02 - 2015-01-01
2015-01-02 - 2016-01-01
2016-01-02 - Max
Partition Scheme
CREATE PARTITION SCHEME ps_byYears
AS PARTITION pf_byYears
TO ( [FG_1], [FG_2], [FG_1], [FG_2])
(Min / (2014-01-01/ (2015-01-01/ (2016-01-01/
2013-12-01) 2014-12-31) 2015-12-31) Max)
2016-01-01 - Max
Demo
Compresión de Datos
Como funciona
Compresión por fila
• Utiliza el formato de almacenamiento de longitud variable para los tipos
numéricos.
Bigint 1 1 Byte