Search code examples
monetdb

Testing and comparing query performance with MonetDB


I'm trying to run some tests on query times and would like to know if there is a way to turn off caching so data is read from disk every time instead of memory?


Solution

  • MonetDB uses memory-mapped files. The contents of these files are cached by the OS in the page cache, which in Linux will use any free memory. What I do to get fair 'cold' runs (force data being read from dist} is to

    1. Stop the database
    2. Clear file system caches. On Linux, run the following command: sudo bash -c "echo 1 > /proc/sys/vm/drop_caches" (See the Kernel doc for details)
    3. Start the database again and run your query

    Generally, there will be more fluctuation in performance results than if the data is in memory, so I recommend you to repeat this a couple of times to get consistent readings.

    There is a benchmark script (ehannes.sh) that automates much of the process for you.