介绍

CMU 15-445/645 (FALL 2019) 热门的数据库内核开发入门课程,实验部分几乎涵盖一个单机系统所有核心功能,课程非常注重理论与实践结合,讨论系统设计 trade-off 以及实践中是如何在性能,可靠性,稳定性等因素综合考量。

课程老师 Andy Pavlo 非常强,实战经验丰富。

2019 课程一共有 4 个 Lab 实验,今天我们讨论 PROJECT #1 - BUFFER POOL 中的核心要点以及实践。

分析

todo

设计

todo

实践

todo

Clock Replacer test 结果:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
$ cd build
$ make clock_replacer_test
$ ./test/clock_replacer_test
Running main() from gmock_main.cc
[==========] Running 5 tests from 1 test suite.
[----------] Global test environment set-up.
[----------] 5 tests from ClockReplacerTest
[ RUN ] ClockReplacerTest.SampleTest1
[ OK ] ClockReplacerTest.SampleTest1 (0 ms)
[ RUN ] ClockReplacerTest.SampleTest2
[ OK ] ClockReplacerTest.SampleTest2 (24 ms)
[ RUN ] ClockReplacerTest.Victim
[ OK ] ClockReplacerTest.Victim (18 ms)
[ RUN ] ClockReplacerTest.Pin
[ OK ] ClockReplacerTest.Pin (9 ms)
[ RUN ] ClockReplacerTest.Size
[ OK ] ClockReplacerTest.Size (1572 ms)
[----------] 5 tests from ClockReplacerTest (1624 ms total)

[----------] Global test environment tear-down
[==========] 5 tests from 1 test suite ran. (1624 ms total)
[ PASSED ] 5 tests.

Buffer Pool Manager test 结果:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
$ cd build
$ make buffer_pool_manager_test
$ ./test/buffer_pool_manager_test
Running main() from gmock_main.cc
[==========] Running 2 tests from 1 test suite.
[----------] Global test environment set-up.
[----------] 2 tests from BufferPoolManagerTest
[ RUN ] BufferPoolManagerTest.BinaryDataTest
[ OK ] BufferPoolManagerTest.BinaryDataTest (4 ms)
[ RUN ] BufferPoolManagerTest.SampleTest
[ OK ] BufferPoolManagerTest.SampleTest (2 ms)
[----------] 2 tests from BufferPoolManagerTest (7 ms total)

[----------] Global test environment tear-down
[==========] 2 tests from 1 test suite ran. (7 ms total)
[ PASSED ] 2 tests.

附录: