Advanced SQL for Query Tuning and Performance Optimization (2019)

Advanced SQL for Query Tuning and Performance Optimization (2019)

1h 45mAdvanced2019-04-01

Authors

Dan Sullivan

Dan Sullivan

Enterprise Architect, Big Data Expert

Course details

SQL queries can be fast and highly efficient, but they can also be slow and demand excessive CPU and memory resources. For many SQL programmers, occasional bouts with long-running queries and poor performance are simply par for the course. But by gaining a better understanding of how databases translate SQL queries into execution plans, you can take steps to avoid these issues. In this course, Dan Sullivan shows developers how to analyze query execution plans and use data modeling strategies to boost query performance. Dan describes how SQL queries are executed; highlights different types of indexes and how they factor in query tuning; covers several methods for performing joins; and discusses how to use partitioning and materialized views to improve performance.

Learning objectives
How SQL executes queries
Working with PostgreSQL tools for tuning
Bitmap and hash indexes
Using different types of indexes to improve performance
Challenges with joining tables
When to use partitioning to improve performance
Collecting statistics about data in tables

Skills covered

PostgreSQLSQLDatabase AdministrationAdvancedDatabase DevelopmentDatabase ManagementData AnalysisProgramming LanguagesData ScienceBusiness Analysis and StrategyBusiness Software and ToolsOpen SourceSoftware Development

Concepts

Introduction

  • Reduce query reponse time with query tuning
  • What you should know

How SQL Executes a Query

  • From declarative SQL to a procedural execution plan
  • Scanning tables and indexes
  • Joining tables
  • Partitioning data

PostgreSQL Tools for Tuning

  • Installing PostgreSQL
  • Overview of pgAdmin
  • Explain and analyze
  • Example plan - Selecting with a WHERE clause
  • Indexes

Types of Indexes

  • Indexing
  • B-tree indexes
  • B-tree index example plan
  • Bitmap indexes
  • Bitmap index example plan
  • Hash indexes
  • Hash index example plan
  • PostgreSQL-specific indexes

Tuning Joins

  • What affects joins performance
  • Nested loops
  • Nested loop example plan
  • Hash joins
  • Hash join example plan
  • Merge joins
  • Merge join example
  • Subqueries vs. joins

Partitioning Data

  • Horizontal vs. vertical partitioning
  • Partition by range
  • Partition by range example
  • Partition by list
  • Partition by list example
  • Partition by hash
  • Partition by hash example

Materialized Views

  • Materialized views
  • Creating materialized views
  • Refreshing materialized views

Other Optimization Techniques

  • Collect statistics about data in tables
  • Hints to the query optimizer
  • Parallel query execution
  • Miscellaneous tips

Conclusion

  • Next steps
40,000 Toman