开始bool BgBufferSync(void) { …… /* * Information saved between calls so we can determine the strategy * point's advance rate and avoid scanning already-cleaned buffers. */ st...
转载 2012-11-02 16:22:00
50阅读
2评论
开始bool BgBufferSync(void) { …… /* * Information saved between calls so we can determine the strategy * point's advance rate and avoid scanning already-cleaned b...
转载 2012-11-02 15:13:00
38阅读
2评论
开始把BgBufferSync 的代码内容简略化,得到:bool BgBufferSync(void) { …… /* Used to compute how far we scan ahead */ long strategy_delta; int bufs_to_lap; …… ...
转载 2012-11-02 11:38:00
29阅读
2评论
开始重要的是:必须了解到 静态变量的使用,它们是贯穿其BgBufferSync 的主线。在一次次调用中始终存在,值也在累积。bool BgBufferSync(void) { /* info obtained from freelist.c */ int strategy_buf_id; uint32 strategy_passes; ...
转载 2012-11-02 14:51:00
30阅读
2评论
开始,在代码中加入调试信息。无关部分设省略。bool BgBufferSync(void) { …… int bufs_to_lap; …… if (save...
转载 2012-11-02 14:04:00
40阅读
2评论
基本关系是: BackgroundWriterMain 循环中,调用  BgBufferSync()  -->SyncOneBuffer -->FlushBuffer -->smgrwrite 看代码: /* * Main entry point for bgwriter process *
转载 2012-10-24 16:59:00
106阅读
2评论
先看代码:src\backend\storage\buffer\bufmgr.c/* * BgBufferSync -- Write out some dirty buffers in the pool. * * This is called periodically by the background writer process. ...
转载 2012-10-24 15:32:00
114阅读
2评论
之前提到,bgwriter没有检查点就执行BgBufferSync();刷新buffer,下马继续看下多久执行一次,主要是通过BgWriterNap()来配置等待时间 /* * Nap for the configured time, or sleep for 10 seconds if there is no * bgwriter activity configured.
原创 2021-09-07 23:07:16
125阅读
开始简单说就是一开始启动的很频繁(200ms 级),后来没有什么事情可做,就懒惰了。变成了 10秒级别。实际验证如下postgresql.conf 中和 log 相关部分:log_line_prefix = '%m' log_min_messages = info logging_collector = off对 bufmgr.c 的 BgBufferSync的调试
转载 2012-11-02 16:44:00
89阅读
2评论