Está en la página 1de 35

Está por comenzar: Próximos Eventos

Fundamentos sobre los índices en SQL Visualización de Big Data con

Server Power View

20 de Agosto (12 pm GMT -5) 27 de Agosto


Eduardo Castro
Enrique Puig
Resúmen: Mejores prácticas de SQL Server
Los índices son elementos importantísimos a la para implementar SharePoint
hora de optimizar consultas. En esta sesión 3 de Septiembre
abarcaremos los distintos David Sánchez
tipos de índices que existen, veremos como nos
Indices columnares en SQL Server
ayudan a optimizar consultas y finalmente
2014
hablaremos de su mantenimiento..
10 de Septiembre
José L. Rivera
Fundamentos sobre los Índices en SQL Server
20/08/2014
Enrique Puig
MAP | MCITP
DBA at RipLife Gaming Technologies
Blog: www.sqlserverpasion.com
Mail: e.puig@Outlook.es
Twitter: @epuignouselles
Objetivos

• Introducción a los Índices


• ¿Qué son?
• ¿Para que sirven?
• ¿Qué tipos de índices existen?
• ¿Cómo ayudan los índices a mejorar el performance?

3
Agenda

• ¿Qué son los índices?


• Introducción
• Heaps
• Índices clustered
• Índices nonclustered
• Conclusiones
• Preguntas

4
¿Qué son los Índices?

5
Introducción

• Gestores de base de datos guardan información (Datos) en


• Tablas / Relaciones
• Conjuntos de datos no ordenados
• Los datos se almacenan en disco
• Unidad de almacenamiento son Paginas de datos (8KB)

6
Introducción (II)

dbo.Sales

Data Page 1 Data Page 2 Data Page 3 Data Page 4 …

7
Heaps

• ´Montón’ de datos no ordenado


• Un Heap es la Tabla
• Contiene los datos

IAM

Data Data Data Data Data

8
Índices clustered

• Estructura de datos: Árbol B


• Estructura de datos ordenada por clave
• El Índice clustered es la tabla
Root
• Contiene todos los datos
• Nodos hoja
• Primary Key by Default Int. Int

Data Data Data Data

9
Heaps vs. Clustered Indexes
• Clustered Index
• Datos ordenados
• Acceso a datos rápido (KEY)
• Paginas de datos enlazadas
• Acceso secuencial eficiente

• Heaps
• Datos no ordenados
• Paginas de datos no enlazadas
• Acceso secuencial ineficiente
• Consultas extra a la IAM

• Recomendación: Utilizar Clustered Index

10
DEMO: Heaps vs. Índices clustered

11
Índices nonclustered

• Estructura auxiliar a la tabla de datos: Árbol B


• Ordenada por Clave del Índice
• Nodos hoja contienen Root
• Claves de Índice
• Referencia a registro de datos
Int. Int

Key Key Key Key


Ref Ref Ref Ref

12
Índices nonclustered vs. Clustered

Nonclustered INDEX Clustered INDEX

Root Root

Int. Int Int. Int

Key Key Key Key


Data Data Data Data
Ref Ref Ref Ref

KEY + Row Reference Data rows

13
Índices nonclustered con Heaps
Root
• Referencias a Datos INDEX

• Row IDentifier (RID)


Int. Int

Key Key Key Key


RID RID RID RID

Data Data Data Data Data Data Data


HEAP
1 2 3 4 5 6 7

14
Índices nonclustered con Clustered Index
Root
INDEX
• Referencia a Datos
• Clustered Index KEY
Int. Int

Key Key Key Key


Root cl key cl key cl key cl key
Clustered Index

Int. Int

Data Data Data Data


15
DEMO: Índices nonclustered

16
Indices nonclustered de cobertura

• Posibilidad de incluir columnas en Índices


• Acerca datos a los índices
• Nodo Hoja Root

• Eficiencia vs. Espacio


• Reduce Lookups
Int. Int

Key Key Key Key


Ref Ref Ref Ref
COL1 COL1 COL1 COL1
COL2 COL2 COL2 COL2
… … … …
17
DEMO: Índices nonclustered de cobertura

18
Otros tipo de Índices

• Índices nonclustered (Filtrados)


• Índices columnares (New 2012)
• Hash (New 2014 / In-Memory OLTP)
• Menos comunes
• Índices XML
• Índices espaciales (Spatial Indexes)
• Full-Text

19
Conclusiones

• Índices son armas poderosas para acelerar consultas


• Sigue las buenas practicas!!
• Utiliza Clustered Index
• Evitar sobre indexación
• Evitar índices solapados
• Todo tiene un coste
• Mantenimiento de índices con operaciones de escritura

20
¿Preguntas?

Blog: www.sqlserverpasion.com
Mail: e.puig@Outlook.es
Twitter: @epuignouselles

21
Gracias

Blog: www.sqlserverpasion.com
Mail: e.puig@Outlook.es
Twitter: @epuignouselles

22
Manténgase conectado a nosotros!
Visítenos en http://globalspanish.sqlpass.org

/SpanishPASSVC

lnkd.in/dtYBzev

/user/SpanishPASSVC

/SpanishPASSVC
23
PASS Community News
August 2014
Planning on attending PASS Summit 2014? Start saving
today!
• The world’s largest gathering of SQL Server & BI professionals

• Take your SQL Server skills to the next level by learning from the world’s SQL
Server experts, in 190+ technical sessions

• Over 5000 attendees, representing 2000 companies, from 52 countries,


ready to network & learn

Ask your Chapter Leader how to $1,895


save $150 off registration! UNTIL SEPTEMBER 26, 2014
PASS Virtual Chapters Listing
Check out the sqlpass.org for more information on all the Virtual Chapters:

• Application Development • Oracle SQL


• Big Data • Performance
• Book Readers • Powershell
• Business Analytics • Professional Development
• Business Intelligence • Security
• Cloud • Virtualization
• Data Architecture • Women in Technology
• Database Administration • Global Chinese
• DBA Fundamentals • Global French
• Excel BI • Global Hebrew
• Healthcare • Global Italian
• High Availability and Disaster Recovery • Global Portuguese
• InMemory • Global Russian
• Master Data\Data Quality • Global Spanish
Virtual Chapter Meetings – August
VIRTUAL CHAPTER MEETING TOPIC

DBA Fundamentals Aug 5 11:00– 12:00 CDT (UTC -05:00) Rolling Upgraders, The Easy Way
Presented by Argenis Fernandez

Global Spanish Aug 6 12:00-12:30 (UTC -05:00) Los Caso de Uso Para In-Memory OLTP
Presented by Warner Chaves

Global Hebrew Aug 10 17:30-18:30 JDT (UTC +02:00) Take Your SQL Server Development
Process Forward!
Presented by Itai Binyamin

Professional Aug 12 12:00-13:00 EDT (UTC -04:00) Bridging the Communication Gap
Development Between DBA and Developer
Presented by Robert Davis

High Availability and Aug 12 12:00-13:00 CDT (UTC -05:00) Mirroring Start to Finish
Disaster Recovery Presented by Ryan Adams
Virtual Chapter Meetings – August
VIRTUAL CHAPTER MEETING TOPIC
Global Spanish Aug 13 12:00-13:00 (UTC -05:00) Haciendo Preguntas Básicas en Power
BI
Presented by Andrei Garzon

Excel Business Aug 14 11:00-12:00 EDT (UTC-04:00) Advanced Analytics: Excel Solver
Intelligence Presented by Dan Fylstra

Business Intelligence Aug 14 11:00-12:00 EDT (UTC -04:00) Continuous Integration for Reporting
Services
Presented by Nat Sundar

DBA Fundamentals Aug 19 11:00-12:00 CDT (UTC -05:00) The Roadmap to Better Performance:
Reading Query Plans
Presented by Erin Stellato

Global Spanish Aug 20 12:00-12:30 (UTC -05:00) Fundamentos sobre lost indices end
SQL
Presented by Enrique Puig
Virtual Chapter Meetings – August
VIRTUAL CHAPTER MEETING TOPIC
Global Russian Aug 20 15:00-16:30 (UTC +03:00) SSIS - Повышение
производительности обработки
потоков данных
Global French Aug 21 20:00-21:00 RST (UTC +01:00) Power BI Hybride avec la Passerelle de
Gestion de Données
Presented by Jean-Pierre Riehl

Business Analytics Aug 21 12:00-13:00 CDT (UTC -05:00) Looking Through the Windshield:
Creating forward-looking Dashboards
and KPI’s
Presented by Brian Larson
Business Intelligence Aug 27 12:00-13:00 GMT (UTC-00:00) Intro to R
Presented by Stephanie Locke

Global Spanish Aug 27 12:00-13:00 (UTC-05:00) Visualización de Big Data Con Power
View
Presented by Eduardo Castro
Upcoming SQLSaturdays
Upcoming North America Events Upcoming International Events

• Aug 2 #324 Baton Rouge • Aug 30 #327 Johannesburg


• Aug 9 #304 Indianapolis • Aug 30 #317 Oslo

• Aug 23 #328 Birmingham • Sep 6 #301 Cape Town


• Sep 13 # 323 Paris
• Aug 23 #309 Oklahoma City
• Sep 20 #290 Kiev
• Sep 6 #320 Raleigh
• Sep 20 #310 Dublin
• Sep 13 #300 Kansas City • Sep 27 #325 Sao Paulo
• Sep 20 #331 Denver

• Sept 20 # 340 San Diego

Visit www.sqlsaturday.com to
register for an event near you!
Volunteering with PASS

Volunteer Today!
Now it’s easier than ever to volunteer with PASS.

Let us know your volunteer preferences by updating the


“myVolunteering” section of your myPASS profile.

PASS would not exist without our passionate, dedicated,


and hardworking volunteers from around the globe.

31
Volunteering with PASS

Outstanding Volunteer Award PASSion Award

Do you know a volunteer that has gone The highest of PASS accolades presented
above and beyond recently? yearly to a volunteer.
Nominate them for the monthly OVA. Nominations will open in August 2014.

VolunteerRecognition@sqlpass.org Stay tuned!


32
Stay Involved!
• Sign up for a free membership today at sqlpass.org

• Linked In: http://www.sqlpass.org/linkedin


• Facebook: http://www.sqlpass.org/facebook
• Twitter: @SQLPASS
• PASS: http://www.sqlpass.org
Programa de Reconocimiento

Programa de Voluntario Sobresaliente

• PASS le invita a nominar a su voluntario favorito para ser “Voluntario Sobresaliente del
Mes”

• Enviar nominaciones en todo momento a: VolunteerRecognition@sqlpass.org


Favor proveer:
• Información de contacto del nominado,
• una lista breve de los programas de PASS que a participado el nominado
• los años que lleva activo en la comunidad
• una corta descripción por el cual considera que esta persona debe ser reconocida

• Los nominados seleccionados serán anunciados en la edición del boletín PASS Connector
y recibirán un certificado de apreciación.
Próximo Evento
Visualización de Big Data con Power View
27 de Agosto (12 pm GMT -5)
Eduardo Castro
Resúmen:
En esta sesión veremos ejemplos,de como realizar
análisis de big data con PowerView integrato con
HDInsight y HortonWorks.

También podría gustarte