PostgreSQL Query Optimization: The Ultimate Guide to Building Efficient Queries

Dombrovskaya, Henrietta, Novikov, Boris, Bailliekova, Anna

  • 出版商: Apress
  • 出版日期: 2024-01-09
  • 定價: $1,800
  • 售價: 9.5$1,710
  • 語言: 英文
  • 頁數: 344
  • 裝訂: Quality Paper - also called trade paper
  • ISBN: 9798868800689
  • ISBN-13: 9798868800689
  • 相關分類: PostgreSQLSQL
  • 立即出貨 (庫存=1)

商品描述

Write optimized queries. This book helps you write queries that perform fast and deliver results on time. You will learn that query optimization is not a dark art practiced by a small, secretive cabal of sorcerers. Any motivated professional can learn to write efficient queries from the get-go and capably optimize existing queries. You will learn to look at the process of writing a query from the database engine's point of view, and know how to think like the database optimizer.

The book begins with a discussion of what a performant system is and progresses to measuring performance and setting performance goals. It introduces different classes of queries and optimization techniques suitable to each, such as the use of indexes and specific join algorithms. You will learn to read and understand query execution plans along with techniques for influencing those plans for better performance. The book also covers advanced topics such as the use of functions and procedures, dynamic SQL, and generated queries. All of these techniques are then used together to produce performant applications, avoiding the pitfalls of object-relational mappers.

This second edition includes new examples using Postgres 15 and the newest version of the PostgresAir database. It includes additional details and clarifications about advanced topics, and covers configuration parameters in greater depth. Finally, it makes use of advancements in NORM, using automatically generated functions.


What You Will Learn
  • Identify optimization goals in OLTP and OLAP systems
  • Read and understand PostgreSQL execution plans
  • Distinguish between short queries and long queries
  • Choose the right optimization technique for each query type
  • Identify indexes that will improve query performance
  • Optimize full table scans
  • Avoid the pitfalls of object-relational mapping systems
  • Optimize the entire application rather than just database queries


Who This Book Is For
IT professionals working in PostgreSQL who want to develop performant and scalable applications, anyone whose job title contains the words "database developer" or "database administrator" or who is a backend developer charged with programming database calls, and system architects involved in the overall design of application systems running against a PostgreSQL database

商品描述(中文翻譯)

撰寫優化的查詢。本書將幫助您撰寫快速且準時提供結果的查詢。您將學習到查詢優化並不是由一小群神秘的巫師所練習的黑暗藝術。任何有動力的專業人士都可以從一開始就學會撰寫高效的查詢並能夠優化現有的查詢。您將學習從資料庫引擎的角度來看待撰寫查詢的過程,並且知道如何像資料庫優化器一樣思考。

本書從討論高效系統開始,進而介紹如何測量性能並設定性能目標。它介紹了不同類型的查詢和適用於每個類型的優化技術,例如使用索引和特定的連接算法。您將學習閱讀和理解查詢執行計劃,以及影響計劃以獲得更好性能的技巧。本書還涵蓋了高級主題,如函數和程序的使用、動態SQL和生成的查詢。所有這些技術都將一起用於生成高效的應用程序,避免物件關聯映射器的陷阱。

本次更新的第二版使用了Postgres 15和最新版本的PostgresAir數據庫作為新的示例。它提供了有關高級主題的更多細節和澄清,並更深入地介紹了配置參數。最後,它利用了NORM的進展,使用自動生成的函數。

您將學到什麼:
- 在OLTP和OLAP系統中確定優化目標
- 閱讀和理解PostgreSQL執行計劃
- 區分短查詢和長查詢
- 選擇適合每種查詢類型的優化技術
- 確定能提高查詢性能的索引
- 優化完整表掃描
- 避免物件關聯映射系統的陷阱
- 優化整個應用程序而不僅僅是數據庫查詢

本書適合對PostgreSQL進行工作的IT專業人士,希望開發高效且可擴展應用程序的人,任何職稱中包含“數據庫開發人員”或“數據庫管理員”的人,或者負責編寫數據庫調用的後端開發人員,以及參與運行在PostgreSQL數據庫上的應用系統的整體設計的系統架構師。

作者簡介

Henrietta Dombrovskaya is a database researcher and developer with over 40 years of academic and industrial experience. She holds a PhD in Computer Science from the University of Saint Petersburg, Russia. At present, she is a Database Architect at DRW Holdings, Chicago, Illinois. She is an active member of the PostgreSQL community, a frequent speaker at the PostgreSQL conference, and the local organizer of the Chicago PostgreSQL User Group. Her research interests are tightly coupled with practice and are focused on developing efficient interactions between applications and databases.

Boris Novikov's experience includes leading post-graduate research groups and advising dozens of PhD students, while partnering and collaborating with industrial clients. His research interests are in the broad area of information management and include design, development, and tuning of databases, applications, and database management systems (DBMSs). He also has interests in distributed scalable systems for stream processing and analytics..

Anna Bailliekova is Senior Data Engineer at UrbanFootprint, where she works on data platform tools and cloud ops for geospatial applications. Previously, she worked in data engineering at Zendesk, and held a variety of DBA and BI roles at Epic. Her writing can be found in the newsletter Better Streets MKE. She received her undergraduate degree with College Honors in Political Science and Computer Science from Knox College in Galesburg, Illinois.

作者簡介(中文翻譯)

Henrietta Dombrovskaya是一位資料庫研究員和開發人員,擁有超過40年的學術和工業經驗。她在俄羅斯聖彼得堡大學獲得計算機科學博士學位。目前,她是芝加哥DRW Holdings的資料庫架構師。她是PostgreSQL社群的活躍成員,經常在PostgreSQL會議上演講,並擔任芝加哥PostgreSQL使用者組的本地組織者。她的研究興趣與實踐緊密相關,主要集中在開發應用程序和數據庫之間高效的交互作用。

Boris Novikov的經驗包括領導研究生研究小組,指導數十名博士生,並與工業客戶合作和合作。他的研究興趣涵蓋了信息管理的廣泛領域,包括數據庫、應用程序和數據庫管理系統(DBMS)的設計、開發和調優。他還對用於流處理和分析的分佈式可擴展系統感興趣。

Anna Bailliekova是UrbanFootprint的高級數據工程師,負責地理空間應用程序的數據平台工具和雲端運營。之前,她在Zendesk擔任數據工程師,並在Epic擔任各種數據庫管理和商業智能角色。她的文章可以在《Better Streets MKE》通訊中找到。她在伊利諾伊州蓋爾斯堡的諾克斯學院獲得政治科學和計算機科學的學士學位,並獲得學院榮譽。