Skip site navigation (1) Skip section navigation (2)

Re: when benchmarking insert , can there be caching effects?

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Willy-Bas Loos" <willybas(at)gmail(dot)com>, <pgsql-performance(at)postgresql(dot)org>
Subject: Re: when benchmarking insert , can there be caching effects?
Date: 2012-01-20 17:53:55
Message-ID: 4F1955D30200002500044A39@gw.wicourts.gov (view raw or flat)
Thread:
Lists: pgsql-performance
Willy-Bas Loos <willybas(at)gmail(dot)com> wrote:
 
> when benchmarking insert , can there be caching effects?
 
Yes.
 
> i insert, delete again, and insert again.
> does anything cache the things that i deleted?
 
Yes.
 
How long you wait before another attempt could have a significant
effect on timings.  There are background processes writing dirty
buffers, checkpointing with fsync to disk, and vacuuming to clean up
those deleted rows.  Until vacuum cleans them up, the deleted rows
will still have index entries which might be searched.  Competition
with background processes could affect performance.  You might have
a table with space already allocated versus needing to ask the OS to
add more space to it.  You might be reusing WAL files versus
creating new ones.  Etc.
 
Getting good benchmarks is hard to do.  For starters, you need to
decide how many of those things *should* be included in the
benchmark.  Then you need to manage things to measure what should be
measured.
 
-Kevin

In response to

pgsql-performance by date

Next:From: Tomas VondraDate: 2012-01-22 23:07:01
Subject: Re: wal_level=archive gives better performance than minimal - why?
Previous:From: Willy-Bas LoosDate: 2012-01-20 15:36:35
Subject: when benchmarking insert , can there be caching effects?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group