CMU 15-445 Lecture #21: Database Crash Recovery Jungle 发布于 2024-04-22 包括在 CMU 15-445 Database SystemsCMU 15-445 Database Systems Lecture #21: Database Crash Recovery Crash Recovery The DBMS relies on its recovery algorithms to ensure database consistency(C), transaction atomicity(A), and durability(D) despite failures. Each recovery algorithm is comprised of two parts: Actions during normal transaction processing to ensure that the DBMS can recover from a failure Actions after a failure to recover the database to a state that ensures the atomicity, consistency, and durability of
CMU 15-445 Lecture #20: Database Logging Jungle 发布于 2024-04-21 包括在 CMU 15-445 Database SystemsCMU 15-445 Database Systems Lecture #20: Database Logging Crash Recovery 情景:数据库运行到一半没电了 Recovery algorithms are techniques to ensure database consistency(C), transaction atomicity(A), and durability(D) despite failures(example no power) The key primitives that used in recovery algorithms are UNDO and REDO. Not all algorithms use both primitives. UNDO: The process of removing the effects of an incomplete or aborted
CMU 15-445 Lecture #19: Multi-Version Concurrency Control Jungle 发布于 2024-04-21 包括在 CMU 15-445 Database SystemsCMU 15-445 Database Systems Lecture #19: Multi-Version Concurrency Control Multi-Version Concurrency Control 常常作为2PL和T/O的辅助手段 The DBMS maintains multiple physical versions of a single logical object in the database(维护多个历史版本(像git)) When a txn writes to
CMU 15-445 Lecture #18: Timestamp Ordering Concurrency Control Jungle 发布于 2024-04-20 包括在 CMU 15-445 Database SystemsCMU 15-445 Database Systems Lecture #18: Timestamp Ordering Concurrency Control Timestamp Ordering Concurrency Control 纯用锁很影响性能,锁是一个悲观的方法 乐观的方法:用时间戳 If $TS(T_i) < TS(T_j)$, then the DBMS must ensure that the execution schedule is equivalent to the serial schedule where $T_i$appears before $T_j$ . Multiple implementation strategies: →
CMU 15-445 Lecture #17: Two-Phase Locking Jungle 发布于 2024-04-19 包括在 CMU 15-445 Database SystemsCMU 15-445 Database Systems Lecture #17: Two-Phase Locking Transaction Locks 在操作数据的时候通过DBMS的锁管理器给数据上一把锁,这样就可以避免并发的数据竞争问题 但是这个锁怎么加怎么解的方案需要设
CMU 15-445 Lecture #16: Concurrency Control Theory Jungle 发布于 2024-04-15 包括在 CMU 15-445 Database SystemsCMU 15-445 Database Systems Lecture #16: Concurrency Control Theory Motivation Lost Update Problem (Concurrency Control):数据竞争 Durability Problem (Recovery):故障恢复 Transactions 特点:ACID Atomicity: Atomicity ensures that either all actions in the transaction happen, or none happen. Consistency: If each transaction
CMU 15-445 Lecture #15: Query Planning & Optimization Jungle 发布于 2024-04-15 包括在 CMU 15-445 Database SystemsCMU 15-445 Database Systems Lecture #15: Query Planning & Optimization 数据库最复杂的模块之一,论文都在这个上面做功夫 Overview SQL都是声明式的,没有告诉DBMS执行的过程 需要优化器来根据SQL告诉
CMU 15-445 Lecture #14: Query Execution II Jungle 发布于 2024-04-12 包括在 CMU 15-445 Database SystemsCMU 15-445 Database Systems Lecture #14: Query Execution II Background 上节课讨论了DBMS的执行过程 这节课讨论DBMS在多线程下的执行过程 Parallel vs Distributed Databases 并行和分布式数据库 Parallel DBMSs 资源都在一块,离得很近
CMU 15-445 Lecture #13: Query Processing I Jungle 发布于 2024-04-12 包括在 CMU 15-445 Database SystemsCMU 15-445 Database Systems Lecture #13: Query Processing I Query Plan 就是前面提到的执行树 同一个SQL可以有很多执行计划 Processing Models Approach #1: Iterator Model Approach #2: Materialization Model Approach #3: Vectorized / Batch Model Iterator Model 每一个算子需要提供一个Next(
CMU 15-445 Lecture #11: Joins Algorithms Jungle 发布于 2024-04-12 包括在 CMU 15-445 Database SystemsCMU 15-445 Database Systems Lecture #11: Joins Algorithms Introduction 根据数据库的范式理论,设计数据库表的一个原则是不让数据冗余,所以在查找的时候JOIN的操作是少不了的 For binary joins, we often prefer the left table (the ”