Last updated: 2007-04-02 15:30:00

Introduction

These tests were designed to test:
  1. The value of the Synchronized Scan patch
  2. The interactions between the Synchronized Scan patch and Simon Riggs' "recycle buffers" patch
  3. The value of the Synchronized Scan patch's concept of "scan offset" which attempts to use blocks that were cached before the scan began.

Code

All tests were 8.2.3 with one, both, or neither of the following patches applied:

Machines

Note that the table sizes are different, so don't directly compare M1 and M2 timings. The table sizes are different becuase the physical memory is different (and also the I/O systems, of course). The real comparisons in these tests are comparing the presence of the patches against plain 8.2.3.

Benchmarks

Logs

These are the results in the form of logs. This is the "raw data".

MachineScheduler*PatchesBenchmarkGUC sync_seqscan_threshold**GUC sync_seqscan_offsetLog
M1ASNonesingle  Log
M1ASNonescan.rb-10Log
M1ASSSsingle  Log
M1ASSSscan.rb-10Log
M1ASSSscan.rb00Log
M1ASSSscan.rb00.5Log
M1ASSSscan.rb01Log
M1ASSS,RBsingle  Log
M1ASSS,RBscan.rb-10Log
M1ASSS,RBscan.rb00Log
M1ASSS,RBscan.rb00.5Log
M1ASSS,RBscan.rb01Log
M1CFQNonesingle  Log
M1CFQNonescan.rb-10Log
M1CFQSSsingle  Log
M1CFQSSscan.rb-10Log
M1CFQSSscan.rb00Log
M1CFQSSscan.rb00.5Log
M1CFQSSscan.rb01Log
M1CFQSS,RBsingle  Log
M1CFQSS,RBscan.rb-10Log
M1CFQSS,RBscan.rb00Log
M1CFQSS,RBscan.rb00.5Log
M1CFQSS,RBscan.rb01Log
M2FreeBSDNonesingle  Log
M2FreeBSDNonescan.rb-10Log
M2FreeBSDSSsingle  Log
M2FreeBSDSSscan.rb-10Log
M2FreeBSDSSscan.rb00Log
M2FreeBSDSSscan.rb00.5Log
M2FreeBSDSSscan.rb01Log
M2FreeBSDSS,RBsingle  Log
M2FreeBSDSS,RBscan.rb-10Log
M2FreeBSDSS,RBscan.rb00Log
M2FreeBSDSS,RBscan.rb00.5Log
M2FreeBSDSS,RBscan.rb01Log

*: Linux allows pluggable schedulers. AS stands for "anticipatory scheduler", CFQ stands for "completely fair queuing".

**: "-1" means disabled, "0" means all scans are synchronized.

Conclusions

Operating on Linux with the Anticipatory Scheduler (AS) with offset=0 gives ideal results for my patch: concurrent scans operate as if no other scan was in progress. This is true even in the presence of Simon Riggs' recycle buffers patch. This is a very big improvement over plain 8.2.3.

There are a few anomolies in the data that I might need to re-test. These anomolies are all on M1, which is my home machine. There's a possibility that other software made I/O requests during a test. I'll post updated data after the re-test.

On FreeBSD, the results were not quite ideal, but still much better than plain 8.2.3.

On Linux with CFQ, the results were still better than with plain 8.2.3 by about 2 times. However, I believe that it's nowhere near ideal because CFQ is not properly doing readahead in the case of the Synchronized Scan patch.

I did not observe any negative reactions between my patch and Simon's.

The results for sync_seqscan_offset were disappointing. I do not think these tests made a compelling case for the sync_seqscan_offset feature. Unless better numbers appear, I will most likely remove this aspect from the final version of my Synchronized Scan patch.