Re: Oracle vs PostgreSQL in real life

From: "Hannu Krosing" <hannu(at)itmeedia(dot)ee>
To: "Jean-Paul ARGUDO" <jean-paul(dot)argudo(at)idealx(dot)com>, "Hannu Krosing" <hannu(at)krosing(dot)net>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Oracle vs PostgreSQL in real life
Date: 2002-02-28 13:24:15
Message-ID: 002701c1c05b$38252580$1600000a@tm.ee
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

----- Original Message -----
From: "Jean-Paul ARGUDO" <jean-paul(dot)argudo(at)idealx(dot)com>
>
>
> PS: I am currently testing vacuums between the script to pause the data
> manipulation, make a vacuum analyze and continue the treatments.
>

I ran a small test (Pg 7.2, RH 7.1, Athlon 850, 512Mb) that created a small
table of 2 fields with primary key on first,
filled it with 768 values and then run the following script:

--------------------------------
#!/usr/bin/python

import pg, random
con = pg.connect()
q = "update t01 set val='bum' where i = %s"
for trx in range(5000):
con.query('begin')
for cmd in range(20):
rn = random.randint(1,768)
con.query(q % rn)
con.query('commit')
--------------------------------

when run as is it made average of 152 updates/sec
[hannu(at)taru hannu]$ time ./abench.py

real 10m55.034s
user 0m27.270s
sys 0m4.700s

after doing a vacuum full i run it together with a parallel process
that was a simple loop sleeping 5 sec and then doing vacuum

--------------------------------
#!/usr/bin/python

import time, pg

con = pg.connect()

for trx in range(5000):
for cmd in range(20):
time.sleep(5)
print 'vacuum'
con.query('vacuum')
print 'done!'
--------------------------------

The same script runs now at average 917
[hannu(at)taru hannu]$ time ./abench.py

real 1m48.416s
user 0m16.840s
sys 0m3.300s

So here we have a case where the new vacuum can really save a day !

I also tried other vacuuming intervals and it seems that ~4 sec is the best
for this case

here are test results
interval - time - updates per sec

2 sec - 1.53.5 - 881
3 sec - 1.49.6 - 912
4 sec - 1.48.0 - 925
5 sec - 1.48.4 - 922
6 sec - 1.49.7 - 911
10 sec - 1.56.8 - 856
no vac - 10.55.0 - 152
--------------
Hannu

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jean-Paul ARGUDO 2002-02-28 13:39:47 Re: Oracle vs PostgreSQL in real life
Previous Message Hannu Krosing 2002-02-28 12:46:38 Re: Oracle vs PostgreSQL in real life