A apresentação está carregando. Por favor, espere

A apresentação está carregando. Por favor, espere

A Evolução do Data Warehousing no Microsoft SQL Server 2008

Apresentações semelhantes


Apresentação em tema: "A Evolução do Data Warehousing no Microsoft SQL Server 2008"— Transcrição da apresentação:

1 A Evolução do Data Warehousing no Microsoft SQL Server 2008
Pedro Antonio Galvão Junior Latex São Roque – Engenheiro de Processos MVP – Windows Server System – SQL Server

2 Agenda Visão geral das melhorias de SQL Server 2008 para data warehousing. Considerações sobre caracteristicas de performance.

3 Microsoft SQL Server 2008

4 Data Warehousing Melhorias em toda a caixa
Integration Services, Database Engine, Analysis Services, Reporting Services Melhoria no produto como um todo Foco em performance e escalabilidade End-to-end testing on large scale customer-driven configuration Database Engine: to 100 billion fact table rows, 32 cores Analysis Services: to 25 billion fact table rows, 16 cores

5 Melhorias em Data Warehousing
Extração, Transformação, e Carga (ETL) Consulta e Análise Administração e Gerenciamento Melhorias em Extração, Transformação e CargaMerge, Minimal Merge, Minimal Logging, Insert over DML, Change Data Capture, Integration Services threading model, Lookup Enhancements, Compression

6 Merge Nova instrução DML que combina várias operações DML.
Database Engine Available in CTP Merge Nova instrução DML que combina várias operações DML. Building block para maior eficiencia para ETL. Implementãção compliance SQL-2006.

7 Fonte de dados pode ser qualquer table ou consulta
Database Engine Available in CTP Merge Nova instrução DML que combina várias operações DML. Building block para maior eficiência para ETL. Implementação SQL-2006. Fonte XXXXX XXX XXX XXXX XXX XXXXXXXXXX X XXX XXXX XX XX XXXX XXXXX XXX XX Fonte de dados pode ser qualquer table ou consulta

8 Merge Destino pode ser qualquer tabela ou view atualizável
Database Engine Available in CTP Merge Nova instrução DML que combina várias operações DML. Building block para maior eficiência para ETL. Implementação SQL 2006. Origem Destino XXXXX XXX XXX XXXX XXX XXXXXXXXXX X XXX XXXX XX XX XXXX XXXXX XXX XX XXXXX X XXXX XXX XXX Destino pode ser qualquer tabela ou view atualizável

9 Se a fonte corresponder com o destino Update
Database Engine Available in CTP Merge Nova instrução DML que combina várias operações DML. Building block para maior eficiência para ETL Implementação SQL 2006 Origem Destino XXXXX XXX XXX XXXX XXX XXXXXXXXXX X XXX XXXX XX XX XXXX XXXXX XXX XX XX XXX XXX XXXXX X XXXX XXX XXX Se a fonte corresponder com o destino Update

10 Se não corresponde, Insert
Database Engine Available in CTP Merge Nova instrução DML que combina várias operações DML. Building block para maior eficiência para ETL. Implementação SQL 2006. Origem Destino XXXXX XXX XXX XXXX XXX XXXXXXXXXX X XXX XXXX XX XX XXXX XXXXX XXX XX XXXXX XXX XXX XXXX XXX XXXXXXXXXX X XXX XXXX XX XX XXXX XXXXX XXX XX XXX XXX Se não corresponde, Insert

11 Se a fonte não corresponde,
Database Engine Available in CTP Merge Nova instrução DML que combina várias operações DML. Building block para maior eficiência para ETL. Implementação SQL 2006. Origem Destino XXXXX XXX XXX XXXX XXX XXXXXXXXXX X XXX XXXX XX XX XXXX XXXXX XXX XX XXXXX XXX XXX XXXX XXX XXXXXXXXXX X XXX XXXX XX XX XXXX XXXXX XXX XX XXX XXX Se a fonte não corresponde, DELETE

12 Merge MERGE Stock S USING Trades T ON S.Stock = T.Stock
Database Engine Available in CTP Merge MERGE Stock S USING Trades T ON S.Stock = T.Stock WHEN MATCHED AND (Qty + Delta = 0) THEN DELETE -- delete stock if Qty reaches 0 WHEN MATCHED THEN -- delete takes precedence over update UPDATE SET Qty += Delta WHEN NOT MATCHED THEN INSERT VALUES (Stock, Delta);

13 Merge MERGE Stock S USING Trades T ON S.Stock = T.Stock
Database Engine Available in CTP Merge MERGE Stock S USING Trades T ON S.Stock = T.Stock WHEN MATCHED AND (Qty + Delta = 0) THEN DELETE -- delete stock if Qty reaches 0 WHEN MATCHED THEN -- delete takes precedence on update UPDATE SET Qty += Delta WHEN NOT MATCHED THEN INSERT VALUES (Stock, Delta) OUTPUT $action, T.Stock, inserted.Delta;

14 Melhorias no Registro de Log
Database Engine Available in CTP Melhorias no Registro de Log Mínima utilização de logs = “loga” somente o que é necessário para Rollback Normalmente linhas individuais são registradas Alocações de paginas são suficientes para inserções de UNDO Modelo de recuperação deve ser simple ou bulklogged. Versões anteriores: CREATE INDEX SELECT INTO BULK INSERT/BCP with TABLOCK

15 Melhorias no Registro de Log
Database Engine Available in CTP Melhorias no Registro de Log SQL Server 2008 INSERT into table suporta o minimo de log 3X-5X Performance Boost over fully logged INSERT Tempo de Execução

16 Database Engine Available in CTP INSERT over DML Abilidade para ter uma instrução INSERT consome resultados de um DML. Melhorias na clausula OUTPUT INTO <table> DML OUTPUT pode ser filtrada com uma cláusula WHERE Não permitido o uso de sub-consultas, dada accessing UDFs e full-text Porque ? History tracking of slowly changing dimensions Dumping DML data stream to a secondary table for postprocessing

17 INSERT over DML INSERT INTO Books (ISBN, Price, Shelf, EndValidDate)
Database Engine Available in CTP INSERT over DML INSERT INTO Books (ISBN, Price, Shelf, EndValidDate) SELECT ISBN, Price, Shelf, GetDate() FROM ( MERGE Books T USING WeeklyChanges AS S ON T.ISBN = S.ISBN AND T.EndValidDate IS NULL WHEN MATCHED AND (T.Price <> S.Price OR T.Shelf <> S.Shelf) THEN UPDATE SET Price = S.Price, Shelf = S.Shelf WHEN NOT MATCHED THEN INSERT VALUES(S.ISBN, S.Price, S.Shelf, NULL) OUTPUT $action, S.ISBN, Deleted.Price, Deleted.Shelf ) Changes(Action, ISBN, Price, Shelf) WHERE Action = 'UPDATE’;

18 Database Engine Available in CTP Change Data Capture Mecanismo para facilitar o rastreamento de alterações em tabelas: Alterações capturadas do log de modo assíncrono Informações sobre o que foi alterado na fonte de dados Table-Valued Functions (TVF) para consultar dados alterados Facilmente consumido através do Integration Services XXXXX XXX XXX XXXX XXX XXXXXXXXXX X XXX XXXX XX XX XXXX XXXXX XXX XX XXXXX XXX XXX XXXX XXX XXXXXXXXXX X XXX XXXX XX Capture process Transaction log Biz needs lower latency  right time BI Global ops and larger data volumns leads to smaller windows for loading Source table XXX XXXXXX CDC functions Change table

19 Database Engine Available in CTP Change Data Capture Mecanismo para facilitar o rastreamento de alterações em tabelas: Alterações capturadas do log de modo assíncrono Informações sobre o que foi alterado na fonte de dados Table-Valued Functions (TVF) para consultar dados alterados Facilmente consumido através do Integration Services XXXXX XXX XXX XXXX XXX XXXXXXXXXX X XXX XXXX XX XX XXXX XXXXX XXX XX XXXXX XXX XXX XXXX XXX XXXXXXXXXX X XXX XXXX XX Capture Process sys.sp_cdc_enable_db_change_data_capture sys.sp_cdc_enable_table_change_data_capture Transaction Log Biz needs lower latency  right time BI Global ops and larger data volumns leads to smaller windows for loading Source Table XXX XXXXXX cdc.fn_cdc_get_all_changes_<instance> cdc.fn_cdc_get_net_changes_<instance> Change Table CDC Functions

20 New Lookup Lookup initialization taking longer than ETL process?
Integration Services New Lookup Lookup initialization taking longer than ETL process? Any clever workarounds for max cache size? New lookup transformation: Unrestricted cache size Persistent cache

21 Compressão de Dados Shrink DW em tabelas fato
Database Engine Compressão de Dados Shrink DW em tabelas fato Melhora na performance de Consultas Habilitado por tabela ou indice Tradeoff em utilização de CPU

22 Data Compression 20070601 4911-403C-98 10 0.00 4911-403C-99 20070602
Database Engine Data Compression DateId CarrierTracking OfferID PriceDisc C-98 10 0.00 C-99 6431 6431-4D57-83 6431-4D57-84 6431-4D57-85 100.00 4E0A-4F89-AE

23 Data Compression Microsoft® SQL Server™ 2005 Service Pack 2 (SP2)
Database Engine Data Compression DateId CarrierTracking OfferID PriceDisc C-98 10 0.00 C-99 6431 6431-4D57-83 6431-4D57-84 6431-4D57-85 100.00 4E0A-4F89-AE Microsoft® SQL Server™ 2005 Service Pack 2 (SP2) VarDecimal Permite utilizar valores decimais para armazenamento de dados de tamanho variável. DateId CarrierTracking OfferID PriceDisc C-98 10 0.00 C-99 6431 6431-4D57-83 6431-4D57-84 6431-4D57-85 100.00 4E0A-4F89-AE

24 Data Compression Coluna com tamanho fixo:
Database Engine Data Compression DateId CarrierTracking OfferID PriceDisc C-98 10 0.00 C-99 6431 6431-4D57-83 6431-4D57-84 6431-4D57-85 100.00 4E0A-4F89-AE Coluna com tamanho fixo: SQL Server 2008 estende a lógica de tamanho fixo para todos os tipos de campos: int, bigint, etc. DateId CarrierTracking OfferID PriceDisc C-98 10 0.00 C-99 6431 6431-4D57-83 6431-4D57-84 6431-4D57-85 100.00 4E0A-4F89-AE

25 Data Compression Compressão de Prefixo:
Database Engine Data Compression DateId CarrierTracking OfferID PriceDisc C-98 10 0.00 C-99 6431 6431-4D57-83 6431-4D57-84 6431-4D57-85 100.00 4E0A-4F89-AE Compressão de Prefixo: A lista de prefixos é armazenada na página para prefixos comuns. Valores individuais são substituidos: Token para prefixo Sufixo para valor DateId CarrierTracking OfferID PriceDisc 1 8 10 0.00 9 2 3 4 5 100.00 4E0A-4F89-AE 1 2 C-9 3 6431-4D57-8 1 2 1 2 1 3 4 1 3 1 3 1 3 1

26 Data Compression Dicionário de compressão:
Database Engine Data Compression DateId CarrierTracking OfferID PriceDisc 1 8 10 0.00 9 2 3 4 5 100.00 4E0A-4F89-AE 1 2 C-9 3 6431-4D57-8 Dicionário de compressão: O valor comum é armazenado na página Valores comuns são substituidos por tokens 2X para 7X taxa de compressão real para dados fato no DW de forma antecipada, dependendo do dado 1 2 1 2 1 3 4 1 3 1 3 1 3 1 DateId CarrierTracking OfferID PriceDisc 8 9 3 4 5 100.00 4E0A-4F89-AE 1 2 C-9 3 6431-4D57-8 1 1 2 2 3 10 4 0.00 1 1 2 3 4 1 1 2 3 4 1 2 3 4 3 4 1 2 3 3 4 1 2 3 3 4 1 2 3 3 1 3 4

27 Analysis Services Available in CTP Melhorias no Designer Um bom desenvolvimento pode oferecer melhorias de performance e escalabilidade Utilizando melhores práticas para integridade baseando-se no conhecimento dentro do designer. Apresentação de relacionamentos e atributos, melhorias nos assistentes, simples criação e representação de chaves, Alertas Melhorias na suportabilidade

28 Melhorias em Data Warehousing
Consulta e Análise Administração e Gerenciamento ETL Melhorias em Consultas e Analise Parallelism for Partitioning, Star Join processing, Grouping Sets, Subspace Computation

29 Paralelismo em Tabelas Particionadas
Database Engine Paralelismo em Tabelas Particionadas Table: Orders Partitioned on a weekly basis on OrderDate Segunda-Feira Execução de Relatórios Semanais Tempo de resposta alto Usuários Contentes Terça - Feira Execução de Relatórios Semanais Tempo de resposta baixo Usuários não contentes Porque ?

30 Paralelismo em Tabelas Particionadas
Database Engine Paralelismo em Tabelas Particionadas Table: Orders Partitioned on a weekly basis on OrderDate Multiple threads on a single partition Segunda-Feira Manhã Execução relatório semanal Tempo de resposta alto Usuário Felizes

31 Paralelismo em Tabelas Particionadas
Database Engine Paralelismo em Tabelas Particionadas Table: Orders Partitioned on a weekly basis on OrderDate Single thread per partition Terça-Feira Manhã Execução relatório semanal Tempo de resposta baixo Usuários não contentes

32 Paralelismo em Tabelas Particionadas
Database Engine Paralelismo em Tabelas Particionadas Table: Orders Partitioned on a weekly basis on OrderDate SQL Server 2008: Várias threads em todas partitições e.g. 64 threads moving across partitions Addresses major motivation for hybrid Range/Hash requests

33 Paralelismo em Tabelas Particionadas
Database Engine Paralelismo em Tabelas Particionadas Two data points 4-core machine (x64) 40-GB fact table Partitioned by week Warm start “Find total sales between 1/6/02 and 1/13/02.” SQL Server 2005*: 1276 (ms) SQL Server 2008: 368 (ms) Worst-case scenario 64-way machine Query touches two partitions Most of the data is on one partition SQL Server 2005: (ms) SQL Server 2008: 992 (ms) select sk_date_id, sum(sales_qty*sale_amt) from tbl_fact_store_sales s where s.sk_date_id between and group by sk_date_id order by sk_date_id asc 3.5x 15x * Microsoft® SQL Server™ 2005

34 Star Join Query Processing
Database Engine Available in CTP Star Join Query Processing Fact table Dimension 1 Dimension 2 Dimension 3 Dimension 4 Table scan SQL Server 2008 additional query plans considered SQL Server 2005 strategies

35 Star Join Query Processing
Database Engine Available in CTP Star Join Query Processing Hash join Dimension 2 Hash join Dimension 1 Fact table scan

36 Star Join Query Processing
Database Engine Available in CTP Star Join Query Processing Hash join SQL Server 2005 can create one bitmap filter Dimension 2 Hash join Bitmap filter Dimension 1 Fact table scan

37 Star Join Query Processing
Database Engine Available in CTP Star Join Query Processing Hash join SQL Server 2008 can create multiple bitmap filters Bitmap filter 1 Dimension 2 Hash join Bitmap filter 2 Dimension 1 Fact table scan

38 Star Join Query Processing
Database Engine Available in CTP Star Join Query Processing Hash join SQL Server 2008 can move and reorder the filters Dimension 2 Hash join Bitmap filter 2 Bitmap filter 1 Dimension 1 Fact table scan

39 Star Join: Early Results
Database Engine Available in CTP Star Join: Early Results 11 queries slower 24 queries faster 17 queries slower 38 queries faster Customer lab: Query response: >1hr Manual Tuning: 55 sec SQL Server 2008: 35 sec 27 queries slower 58 queries faster

40 Analysis Services Subspace Computation Goal: MDX Query Performance—Minimize the space on which calculations are performed Cube space is generally “sparse” Values only exist for small number of combinations of dimension keys SQL Server 2005 evaluates expressions on complete space

41 Analysis Services Subspace Computation Goal: MDX Query Performance—Minimize the space on which calculations are performed SQL Server 2008 divides the space to separate calculated members, regular members and empty space SP2 includes some subspace computation Analysis and evaluation of calculations for each cell Null/default values substituted on subspace basis

42 Melhorias em Relatório
Reporting Services Melhorias em Relatório Scalable reporting engine IIS agnostic deployment Reenderização em Word More flexible report layout Enhanced data visualization

43 Melhorias em Data Warehousing
Consulta e Análise Administração e Gerenciamento ETL Melhorias em Administração e Gerenciabilidade Backup Compression, Backup Enhancements, Resource Governor

44 Compressão de Backup Pontos: SQL Server 2008
Database Engine Compressão de Backup Pontos: Criar backups baseados em disco de forma online. Backups com longo tempo de duração podem ser compactados. SQL Server 2008 WITH COMPRESSION utilizado com BACKUP Menor armazenamento requirido para manter backups online Backups são executados mais rápido, menor IO é feito. Restore automaticamento detecta a compressão e faz o ajuste necessário

45 Melhorias no Backup Pain points: SQL Server 2008:
Analysis Services Melhorias no Backup Pain points: Exponential growth of backup times for databases over 20 GB Limitations on the size of individual database files and number of metadata files SQL Server 2008: Replace the AS Backup storage subsystem Ensure backup times grow linearly with size of database Remove limitations on backup size, and metadata files

46 Analysis Services Performance no Backup

47 SQL Server 2005 Resource Management
Database Engine SQL Server 2005 Resource Management SQL Server Pool de recursos Único Database engine não diferencia workloads Best effort resource sharing Executive reports Backup OLTP* activity Admin tasks Specific reports Admin workload OLTP workload Report workload Memory, CPU, threads… Resources * Online Transaction Processing (OLTP)

48 Resource Governor Workloads
Database Engine Resource Governor Workloads SQL Server Abilidade para diferenciar workloads Exemplo: app name, login Limite de recursos: Max memory % Admin Tasks Ad‐hoc Reports Max CPU time Grant timeout Max Requests Monitoramento de Recursos Executive reports Backup OLTP activity Admin tasks Specific reports Admin workload OLTP workload Report workload Memory, CPU, threads… Resources

49 Resource Governor Importance
Database Engine Resource Governor Importance SQL Server A carga de trabalho pode ter um rótulo de importância: Low Medium High Preferência de Alocação de recursos baseado na importância Executive reports Backup OLTP activity Admin tasks Specific reports High Admin workload OLTP workload Report workload Memory, CPU, threads… Resources

50 Resource Governor Pools
Database Engine Resource Governor Pools SQL Server Resource pool: A virtual subset of physical database engine resources Oferece controle para definir: Min memory % Max memory % Min CPU % Max CPU % Max DOP Monitoramento de recursos Permite até 20 recursos por Pool Executive reports Backup OLTP activity Admin tasks Specific reports High Admin workload OLTP workload Report workload Min memory 10% Max memory 20% Max CPU 20% Max CPU 90% Admin pool Application pool

51 Resource Governor Putting it all together Benefício Principal
Database Engine Resource Governor SQL Server Putting it all together Workloads são mapeados para Resource Pools (n : 1) Alterações online of groups/pools SQL Server 2005 = default group + default pool Benefício Principal Prevenção durante a exeução da query Executive reports Backup OLTP activity Admin tasks Specific reports High Admin workload OLTP workload Report workload Min memory 10% Max memory 20% Max CPU 20% Max CPU 90% Admin pool Application pool

52 Mais informações sobre
Database Engine: Grouping sets Partition-aligned indexed views Separate date/time data types Locking enhancements Analysis Services: Query tracing Writeback performance Read-only scalable database Resource monitoring Integration Services: Visual Studio* Tools for Applications (VSTA) scripting Data flow thread allocation * The Microsoft® Visual Studio® development system

53 Grouping Sets Extension to the GROUP BY clause
Database Engine Available in CTP Grouping Sets Extension to the GROUP BY clause Lets you define multiple groupings in the same query Produces a single result set that is equivalent to a UNION ALL of differently grouped rows Makes aggregation querying and reporting easier and faster

54 Data Flow Thread Allocation
Integration Services Available in CTP Data Flow Thread Allocation Previous releases Static thread assignment to sub expressions SQL Server 2008 Dynamic thread assignment to operators What does it mean? Dramatic improvement of parallelism for long computational chains Thread starvation prevention Better performance in simple cases Expected improvements: From a small percentage to 2X

55 Subspace Computation: SP2
Analysis Services Subspace Computation: SP2 Number of executions for all reports Number of executions for interactive reports Median execution for all reports (sec) Median execution for Int. reports (sec)

56 Conclusão O Microsoft SQL Server 2008, apresenta uma nova forma de trabalho relacionada a descoberta de dados, permitindo trabalhar com o datawarehousing de uma maneira mais fácil, principialmente nos processos de carga, transformação e extração de dados, oferecendo ainda mais flexibilidade, performance e segurança.

57 Maiores informações Visite TechNet www.microsoft.com/technet/brasil
Visite MSDN SQL Server Express home page SQL Server Express Edition overview

58 Fóruns e Colunas Técnicas
Media Center: Fórum – TechNet – SQL Server: Fórum – MSDN – SQL Server:

59 Connect with TechNet Microsoft’s TechNet programs provide IT professionals with high-quality, how-to information and resources to efficiently evaluate, deploy, maintain and support their Microsoft technology. To learn more, subscribe, or attend a free briefing, please visit: Free Technical Briefings: TechNet Webcasts: TechNet Flash Newsletter: TechNet Online: Security Notification Service Sign-Up: TechNet Subscription*: Stay up to date on security with the monthly Microsoft Security Newsletter and get technical alerts when an important security bulletin or virus alert is released with the Microsoft Security Notification Service, visit to sign up.

60 Questões ?

61 Blog

62

63

64

65

66 Seu potencial. Nossa inspiração.MR
© 2006 Microsoft Corporation. Todos os direitos reservados. O propósito desta apresentação é apenas informativa. Microsoft não faz nenhuma garantia expressa ou implícita nesta apresentação. Seu potencial. Nossa inspiração.MR 66


Carregar ppt "A Evolução do Data Warehousing no Microsoft SQL Server 2008"

Apresentações semelhantes


Anúncios Google