Postgres, MVCC, và bạn hoặc, Tại sao COUNT(*) lại chậm (David Wolever)

Tác giả: PyCon Canada
Ngày xuất bản: 2018-05-07T00:00:00
Length: 29:39

It's hard to be a developer today without using a database… but they're often surrounded by an air of reverent mystery.

One of those mysteries is why it's so slow to count all the rows in a table using COUNT(*). After all, it's just a matter of walking a b-tree and counting leaves… and that should be trivial to optimize!

In this talk I'll answer the question of "why COUNT(*) is slow" by taking a deep dive into the the internals of Postgres' MVCC implementation, looking at:

The question of "why COUNT(*) is slow"

The on-disk storage layout and why, under the hood, it's not a b-tree

What Postgres means by MVCC, with examples of the utility of transactions

Introduce xid, xmin, xmax

Discuss tuple visibility

Explain VACUUM and xid wraparound

Show off transaction isolation levels

This talk is accessible to anyone who's used an SQL database, with enough depth that experienced developers will find some interesting tidbits.

Presentation page -- https://2017.pycon.ca/schedule/25/

Dịch Vào Lúc: 2025-03-30T03:14:34Z

Yêu cầu dịch (Một bản dịch khoảng 5 phút)

Phiên bản 3 (ổn định)

Tối ưu hóa cho một người nói. Phù hợp cho video chia sẻ kiến thức hoặc giảng dạy.

Video Đề Xuất