๐”– Scriptorium
โœฆ   LIBER   โœฆ

๐Ÿ“

SQL Performance Explained Everything Developers Need to Know about SQL Performance

โœ Scribed by Markus Winand


Publisher
Markus Winand
Year
2023
Tongue
English
Leaves
369
Category
Library

โฌ‡  Acquire This Volume

No coin nor oath required. For personal study only.

โœฆ Synopsis


SQL Performance Explained helps developers to improve database performance. The focus is on SQLโ€”it covers all major SQL databases without getting lost in the details of any one specific product.

Starting with the basics of indexing and the WHERE clause, SQL Performance Explained guides developers through all parts of an SQL statement and explains the pitfalls of object-relational mapping (ORM) tools like Hibernate.

Topics covered include
โ€ข Using multi-column indexes
โ€ข Correctly applying SQL functions
โ€ข Efficient use of LIKE queries
โ€ข Optimizing join operations
โ€ข Clustering data to improve performance
โ€ข Pipelined execution of ORDER BY and GROUP BY
โ€ข Getting the best performance for pagination queries
โ€ข Understanding the scalability of databases

Its systematic structure makes SQL Performance Explained both a textbook and a reference manual that should be on every developerโ€™s bookshelf.

Covers all major databases: Oracleยฎ Database, SQL Serverยฎ, PostgreSQL, MySQL

What readers say
โ€œThis book is definitively worth having in the company library.โ€ โ€” Joe Celko

โœฆ Table of Contents


............................................................................................ vi

  1. Anatomy of an Index ...................................................................... 1
    The Index Leaf Nodes .................................................................. 2
    The Search Tree (B-Tree) .............................................................. 4
    Slow Indexes, Part I .................................................................... 6

  2. The Where Clause ......................................................................... 9
    The Equality Operator .................................................................. 9
    Primary Keys ....................................................................... 10
    Concatenated Indexes .......................................................... 12
    Slow Indexes, Part II ............................................................ 18
    Functions .................................................................................. 24
    Case-Insensitive Search Using UPPERor LOWER.......................... 24
    User-Defined Functions ........................................................ 29
    Over-Indexing ...................................................................... 31
    Parameterized Queries ............................................................... 32
    Searching for Ranges ................................................................. 39
    Greater, Less and BETWEEN..................................................... 39
    Indexing LIKEFilters ............................................................. 45
    Index Merge ........................................................................ 49
    Partial Indexes ........................................................................... 51
    NULLin the Oracle Database ....................................................... 53
    Indexing NULL....................................................................... 54
    NOT NULLConstraints ............................................................ 56
    Emulating Partial Indexes ..................................................... 60
    Obfuscated Conditions ............................................................... 62
    Date Types .......................................................................... 62
    Numeric Strings .................................................................. 68
    Combining Columns ............................................................ 70
    Smart Logic ......................................................................... 72
    Math .................................................................................. 77

  3. Performance and Scalability ......................................................... 79 Performance Impacts of Data Volume ......................................... 80 Performance Impacts of System Load .......................................... 85 Response Time and Throughput ................................................. 87

  4. The Join Operation ....................................................................... 91
    Nested Loops ............................................................................ 92
    Hash Join ................................................................................. 101
    Sort Merge .............................................................................. 109

  5. Clustering Data ........................................................................... 111
    Index Filter Predicates Used Intentionally ................................... 112
    Index-Only Scan ........................................................................ 116
    Index-Organized Tables ............................................................. 122

  6. Sorting and Grouping ................................................................. 129
    Indexing Order By .................................................................... 130
    Indexing ASC, DESCand NULLS FIRST/LAST...................................... 134
    Indexing Group By .................................................................... 139

  7. Partial Results ............................................................................ 143
    Querying Top-N Rows ............................................................... 143
    Paging Through Results ............................................................ 147
    Using Window Functions for Pagination .................................... 156

  8. Modifying Data .......................................................................... 159
    Insert ...................................................................................... 159
    Delete ...................................................................................... 162
    Update .................................................................................... 163

A. Execution Plans .......................................................................... 165
Oracle Database ....................................................................... 166
PostgreSQL ............................................................................... 172
SQL Server ............................................................................... 180
MySQL ..................................................................................... 188

Index ............................................................................................. 193 v


๐Ÿ“œ SIMILAR VOLUMES


SQL Performance Explained
โœ Markus Winand ๐Ÿ“‚ Library ๐Ÿ“… 2012 ๐Ÿ› Markus Winand (2012) ๐ŸŒ English

SQL Performance Explained helps developers to improve database performance. The focus is on SQL-it covers all major SQL databases without getting lost in the details of any one specific product. Starting with the basics of indexing and the WHERE clause, SQL Performance Explained guides developers th

SQL Performance Tuning
โœ Peter Gulutzan, Trudy Pelzer ๐Ÿ“‚ Library ๐Ÿ“… 2002 ๐Ÿ› Addison-Wesley Professional ๐ŸŒ English

A poorly performing database application can cost each user time, and have an impact on other applications running on the same computer or the same network. This book will help DBA's and programmers improve the performance of their databases. It is not an introduction to SQL, nor is it a tuning manu

SQL Performance Tuning
โœ Peter Gulutzan, Trudy Pelzer ๐Ÿ“‚ Library ๐Ÿ“… 2002 ๐Ÿ› Addison-Wesley Professional ๐ŸŒ English

A poorly performing database application can cost each user time, and have an impact on other applications running on the same computer or the same network. This book will help DBA's and programmers improve the performance of their databases. It is not an introduction to SQL, nor is it a tuning manu

SQL Performance Tuning
โœ Peter Gulutzan, Trudy Pelzer ๐Ÿ“‚ Library ๐Ÿ“… 2002 ๐Ÿ› Addison-Wesley Professional ๐ŸŒ English

Ch. 1. Facilis Descensus Averni -- Ch. 2. Simple Searches -- Ch. 3. Order By -- Ch. 4. Group By -- Ch. 5. Joins -- Ch. 6. Subqueries -- Ch. 7. Columns -- Ch. 8. Tables -- Ch. 9. Indexes -- Ch. 10. Constraints -- Ch. 11. Stored Procedures -- Ch. 12. ODBC -- Ch. 13. JDBC -- Ch. 14. Data Changes -- Ch