Re: SSI patch version 8

Kevin Grittner <kevin.grittner@wicourts.gov>

From: "Kevin Grittner" <Kevin.Grittner@wicourts.gov>
To: Anssi Kääriäinen <anssi.kaariainen@thl.fi>
Cc: "Dan Ports" <drkp@csail.mit.edu>, "john.okite@gmail.org" <john.okite@gmail.org>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2011-01-12T19:18:45Z
Lists: pgsql-hackers
Anssi Kääriäinen<anssi.kaariainen@thl.fi> wrote:
 
> So, count(*) queries are more than twice as slow compared to the
> old serializable transaction isolation level.
 
I've looked at this enough to know that I can do something about
that, but wanted to point out that this is a good example of why you
should specify READ ONLY when possible.  My numbers:
 
begin transaction isolation level repeatable read;
Time: 394.946 ms
Time: 248.675 ms
Time: 242.559 ms

begin transaction isolation level serializable;
Time: 494.676 ms
Time: 494.036 ms
Time: 491.712 ms

begin transaction isolation level serializable, read only;
Time: 234.075 ms
Time: 234.050 ms
Time: 234.057 ms

begin transaction isolation level serializable, read only,
deferrable;
Time: 233.494 ms
Time: 234.099 ms
Time: 235.290 ms
 
The slower times for REPEATABLE READ gave me pause, so I ran those
again:
 
begin transaction isolation level repeatable read;
Time: 233.946 ms
Time: 236.200 ms
Time: 236.414 ms
 
I guess the database just hadn't "warmed up" enough for the first
few tests....
 
-Kevin