Advanced SQL for Query Tuning and Performance Optimization
Learn to tune PostgreSQL queries and fix slow SQL
Advanced SQL for Query Tuning and Performance Optimization is a practitioner-focused course that shows how to make SQL workloads faster and more efficient by interpreting execution plans and applying targeted changes in PostgreSQL. It centers on practical query tuning techniques such as index selection, join strategy, partitioning, and materialized views to reduce CPU, memory, and I/O costs.
Geared toward technicians who already write SQL, the course translates optimizer concepts into repeatable diagnostics and fixes using tools like EXPLAIN/ANALYZE and pg_stat_statements. By the end, learners should be able to analyze slow queries, implement appropriate indexes and partitions, and apply PostgreSQL-specific tuning workflows to improve real-world query performance.
At a Glance
Advanced SQL for Query Tuning and Performance Optimization is a focused LinkedIn Learning course taught by Dan Sullivan that demonstrates how to analyze execution plans and apply practical tuning techniques. The course covers execution plans, index types, join methods, partitioning, materialized views, and PostgreSQL tuning tools to reduce query CPU and memory use.
| Level | Advanced |
| Rating | 4.6 out of 5 |
| Duration | 2+ hours |
| Languages | English |
| Certificate | Certificate of completion (sharable) |
| Access | Access for as long as your LinkedIn Learning subscription is active (1-month free trial available) |
| Course includes |
|
| Price | Included with LinkedIn Learning subscription (subscription-based, monthly or annual plans) |
What This Course Teaches
The course frames outcomes as practical, measurable competencies you can use to diagnose and reduce SQL query cost across real PostgreSQL workloads. Learners will leave able to analyze execution plans, apply index and partitioning strategies, optimize joins, and use PostgreSQL tooling to identify and fix slow queries.
How the Course Is Structured
The course is organized as a sequence of short, focused video lessons grouped into eight technical modules plus introductory and concluding sections. In total it contains 65 individual lessons and runs approximately 2+ hours overall.
Curriculum overview
01Introduction▾
Opening remarks and orientation to the course goals and scope.
02Reduce query response time with query tuning▾
Introduces the motivation for tuning queries and common performance symptoms.
03What you should know▾
Pre-course assumptions and prerequisite knowledge expected of learners.
04From declarative SQL to a procedural execution plan▾
Explains how the SQL optimizer transforms declarative queries into executable plans.
05Scanning tables and indexes▾
Covers how table and index scans operate and their cost implications.
06Joining tables▾
Overview of join processing and factors that influence join performance.
07Partitioning data▾
Introduces partitioning concepts and why partitioning can reduce query scope.
08Challenge: Choosing how to partition a table▾
A short applied exercise prompting selection of an appropriate partitioning strategy.
09Solution: Choosing how to partition a table▾
Instructor walkthrough that explains the recommended partitioning choice.
10Using PostgreSQL in Codespaces▾
Demonstrates how to run PostgreSQL within GitHub Codespaces for hands-on practice.
11Explain and analyze▾
Shows how to use EXPLAIN and ANALYZE to reveal execution plan details and costs.
12Example plan: Selecting with a WHERE clause▾
Walks through an example execution plan for a filtered SELECT statement.
13Indexes▾
Introduces index concepts and how indexes influence plan selection.
14Challenge: Generating a query execution plan▾
A brief task to produce and inspect an execution plan yourself.
15Solution: Generating a query execution plan▾
Instructor solution showing the expected plan output and interpretation tips.
16Indexing▾
Explains core indexing principles and when to add indexes to tables.
17B-tree indexes▾
Covers B-tree index behavior and typical use cases for ordered lookups.
18B-tree index example plan▾
Detailed example showing how a B-tree index appears in an execution plan.
19Bitmap indexes▾
Introduces bitmap indexing concepts and scenarios where they help.
20Bitmap index example plan▾
Example plan illustrating bitmap index usage and cost trade-offs.
21Hash indexes▾
Explains hash index characteristics and limitations.
22Hash index example plan▾
Shows an execution plan example where hash indexing is applied.
23Bloom filter indexes▾
Discusses bloom filters and their use in probabilistic indexing strategies.
24PostgreSQL-specific indexes▾
Highlights index types and extensions unique to PostgreSQL.
25Challenge: Choosing an index▾
Short exercise asking learners to select the best index for a query pattern.
26Solution: Choosing an index▾
Instructor explanation of the chosen index and rationale.
27Types of joins▾
Introduces the join algorithms the optimizer may choose for combining rows.
28Nested loops▾
Describes nested loop join mechanics and when they are efficient.
29Nested loop example plan▾
Example demonstrating a nested loop in a real plan and its cost profile.
30Hash joins▾
Covers hash join behavior and memory considerations.
31Hash join example plan▾
Walks through a plan that uses a hash join and how to interpret it.
32Merge joins▾
Explains merge join prerequisites and performance characteristics.
33Merge join example▾
Example demonstrating merge join behavior in an execution plan.
34Subqueries vs. joins▾
Compares performance trade-offs between subqueries and equivalent joins.
35Challenge: Designing a join▾
A short task to design a join strategy for a given query pattern.
36Solution: Designing a join▾
Instructor-provided solution and reasoning for the join design challenge.
37Horizontal vs. vertical partitioning▾
Compares partitioning approaches and their impact on query patterns.
38Partition by range▾
Introduces range partitioning and typical scenarios for its use.
39Partition by range example▾
Walks through a concrete range partitioning example and effects on plans.
40Partition by list▾
Explains list-based partitioning and when to apply it.
41Partition by list example▾
Example showing list partition implementation and query effects.
42Partition by hash▾
Covers hash partitioning mechanics and typical use cases.
43Partition by hash example▾
Demonstrates a hash partition example and its performance implications.
44Challenge: Partitioning a table▾
A brief exercise to choose an appropriate partitioning approach for a schema.
45Solution: Partitioning a table▾
Instructor solution showing recommended partition boundaries and rationale.
46Materialized views▾
Introduces materialized views as a technique for precomputing expensive results.
47Creating materialized views▾
Shows how to define materialized views in SQL and choose refresh strategies.
48Refreshing materialized views▾
Discusses refresh options and trade-offs between freshness and cost.
49Challenge: Creating a materialized view▾
A practical task to define and refresh a materialized view for a sample query.
50Solution: Creating a materialized view▾
Instructor walkthrough of the materialized view exercise and expected results.
51Collect statistics about data in tables▾
Covers how table statistics are gathered and why they matter to the optimizer.
52Analyzing execution statistics with pg_stat_statements▾
Demonstrates using pg_stat_statements to find frequently run or costly queries.
53Reviewing execution plans with the auto_explain module▾
Shows how auto_explain can automatically capture slow plans for offline analysis.
54Additional analysis with other pg_stats data▾
Explores other pg_stats sources to supplement optimizer decision-making.
55Challenge: Analyze schema statistics▾
An exercise to apply statistics analysis to detect schema-level issues.
56Solution: Analyze schema statistics▾
Instructor solution showing how statistics reveal optimization opportunities.
57Using common table expressions to avoid repetitive computation▾
Shows how CTEs can reduce repeated work and when they help or hurt performance.
58Hints to the Query Optimizer▾
Discusses explicit hints and their limited role in guiding the optimizer.
59Parallel query execution▾
Introduces parallel execution and factors that enable or limit parallelism.
60Improving cache utilization▾
Covers strategies to increase effective caching and reduce disk I/O.
61Miscellaneous tips▾
A collection of practical, miscellaneous tuning tips and heuristics.
62Challenge: Design a common table expression▾
Exercise to design a CTE that avoids redundant computation in a sample query.
63Solution: Design a common table expression▾
Instructor walk-through showing an efficient CTE implementation.
64Conclusion▾
Final reflections, recommended next steps, and summary advice for continued tuning work.
65Next steps▾
Guidance on how to continue practicing and applying the techniques demonstrated in the course.
Audience & Requirements
The course targets technical practitioners who must diagnose and reduce SQL query cost in production systems. It is best suited to data engineers, DBAs, and backend developers who already write SQL and need practical PostgreSQL-focused tuning techniques.
- Data engineers and ETL engineers responsible for pipeline performance.
- Database administrators managing query performance and capacity.
- Backend developers troubleshooting slow application queries.
- BI engineers and analysts who optimize report and aggregation queries.
- Working knowledge of SQL (joins, aggregations, subqueries).
- Familiarity with relational database concepts such as indexes and schemas.
- Access to PostgreSQL (the course demonstrates using GitHub Codespaces; an equivalent PostgreSQL environment is acceptable).
Final Verdict
For professionals responsible for production query performance, this course is a practical, efficient way to acquire targeted tuning techniques. Given its strong user rating, concise runtime, and inclusion on a subscription-based professional learning platform that awards a sharable completion certificate, it delivers high practical value for a modest time investment.
It is best suited to practitioners who already write SQL and need actionable diagnostics and fixes rather than a general introduction; complete beginners should prepare with foundational SQL study first. If you already use the platform, this course is an economical, low-friction way to upskill; if you don’t, consider whether a short subscription or a more lab-heavy offering better fits a longer practice-oriented learning plan.

DataCamp
Codecademy
Pluralsight