[OT] Fast DB access

2001-05-21 Thread Differentiated Software Solutions Pvt. Ltd.,



Hi,

This is a follow up of mails sent to this mailing 
list last month.
We were benchmarking several db access methods and 
comparing them with postgres.
Lots of people advised us to try pg 7.1 instead of 
pg 6.5.3

This turns out to be good advice as regards 
performance. (We would like to implement one application before commenting on 
stability)
We ran the same benchmark as last time. Benchmark 
is some configurable number of selects on a composite primary key.
The results are
number of selects: 
100postgres4605 wallclock secs 
(858.69 usr + 115.92 sys = 974.61 CPU)pg 7.13297 wallclock secs (835.19 
usr + 96.86 sys = 932.05 CPU)mldbm1286 wallclock secs (.71 usr + 
161.86 sys = 1273.57 CPU)
As you can see pg 7.1 is 30% faster than pg 6.5.3 
and 3 times slower than MLDBM.
If people are interested in the benchmark script 
itself, please write to us.

Thanks and Regards,

Murali  S Muthu Ganesh

Differentiated Software Solutions Pvt. Ltd.,90, 
3rd Cross,2nd Main, Ganga Nagar,Bangalore - 560 032Phone : 91 80 
3631445, 3431470Visit us at www.diffsoft.com

BEGIN:VCARD
VERSION:2.1
N:;Murali
FN:Murali
ORG:Differentiated Software Solutions Pvt. Ltd
TITLE:Director
TEL;WORK;VOICE:91 80 3431470
TEL;HOME;VOICE:91 80 3431470
ADR;WORK;ENCODING=QUOTED-PRINTABLE:;;90, 3rd Cross, 2nd Main,=0D=0AGanga Nagar;Bangalore;Karnataka;560032;India
LABEL;WORK;ENCODING=QUOTED-PRINTABLE:90, 3rd Cross, 2nd Main,=0D=0AGanga Nagar=0D=0ABangalore, Karnataka 560032=
=0D=0AIndia
ADR;HOME;ENCODING=QUOTED-PRINTABLE:;;90, 3rd Cross, 2nd Main,=0D=0AGanga Nagar;Bangalore;Karnataka;560032;India
LABEL;HOME;ENCODING=QUOTED-PRINTABLE:90, 3rd Cross, 2nd Main,=0D=0AGanga Nagar=0D=0ABangalore, Karnataka 560032=
=0D=0AIndia
X-WAB-GENDER:2
URL:http://www.diffsoft.com
URL:http://www.diffsoft.com
EMAIL;PREF;INTERNET:[EMAIL PROTECTED]
REV:20010522T042158Z
END:VCARD



Re: [OT] Fast DB access

2001-04-20 Thread Differentiated Software Solutions Pvt. Ltd.,

Hi,

Cees has found a bug in our benchmark. We were using rtrim in our select
statement while doing the benchmark and this was forcing postgres to perform
a table scan.

We've corrected the code for this bug. We are reposting results without
rtrim (creating the tables with varchar).
In fact with postgres even ignores the trailing blanks with 'char' datatype.

When we ran these benchmarks at 40 seconds, we could not make out any
difference in the results.
Instead we increased the number of selects to 2000. Here are the new results
between only postgres(6.5.3) and mldbm
postgres
18 wallclock secs ( 1.88 usr +  0.18 sys =  2.06 CPU)
mldbm
 3 wallclock secs ( 1.77 usr +  0.21 sys =  1.98 CPU)

Results still compare favourably towards MLDBM.

Summary of our learning from the benchmarks and these discussions

a) We have to use PG 7.1. It is a major improvement over 6.5.3
b) When we need a completely read-only high-performance data structure,
MLDBM is a good option against postgres. This is provided we are able to
cast our database in MLDBM style datastructures.
c) Generic benchmarks may not be useful for most applications we need to
device our own benchmark which represents critical processing requirements
and try out various options.

Thanks to all of you who have contributed to this thread.

Regards,

V Murali  S Muthu Ganesh
Differentiated Software Solutions Pvt. Ltd.,
90, 3rd Cross,2nd Main,
Ganga Nagar,
Bangalore - 560 032
Phone : 91 80 3631445, 3431470
Visit us at www.diffsoft.com

- Original Message -
From: Cees Hek [EMAIL PROTECTED]
To: Murali V [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Friday, April 20, 2001 1:45 AM
Subject: [OT] Re: Fast DB access



 On Thu, 19 Apr 2001, Murali V wrote:

  Hi,
 
  If you read the code more deeply, you'll find that the timeit is only
  wrapped around select and not around insert.
  We've written the insert code so that in the first round you can
populate
  the database.
  You comment out the insert code after the first round and run the
benchmark
  several times. This would only do select and time select.
 

 Hi Murali,

 OK, to start off, I was not specifically aiming my rant at you, I was
 replying to someone who had modified your code and was now comparing MySQL
 and PostgreSQL, and he was implying that the timings were for inserts and
 selects.  I took this at face value, and didn't check the code close
 enough which I really should have done in the first place.

  Connecting this error to an axiom that "Benchmarks are useless" is bad
  indeed. Shouldn't we be ironing out errors and runing benchmarks which
are
  good.

 Perhaps I should have said published benchmarks.  In your case, you are
 using benchmarks for exactly what they are intended for...  Creating a
 system that closely resembles your application and putting it through it's
 paces.  What I find dangerous about publishing benchmarks, is that they
 are almost always heavily swayed to a specific application, and most of
 the time they show what the user wants them to show.

 In your original message, you clain to have a bias against Postgres, and
 your benchmark shows that bias.  I however am a happy user of postgres,
 and am therefore biased towards it.  I modified your benchmark script
 slightly, and I got the following results (I have include a diff of my
 changes at the bottom):

 postgres
  0 wallclock secs ( 0.02 usr + 0.01 sys = 0.03 CPU)
 postgres
  0 wallclock secs ( 0.02 usr +  0.00 sys =  0.02 CPU)

 Whereas if I run it with your version I get the following:

 postgres
 27 wallclock secs ( 0.00 usr + 0.00 sys = 0.00 CPU)
 postgres
 27 wallclock secs ( 0.02 usr +  0.00 sys =  0.02 CPU)

 So what does that tell you about the benchmark?  that the postgres part of
 this benchmark is useless...  It may have given you the answer that you
 wanted, but it is misleading to anyone else out there.

 This is why there are always flame wars about benchmarking databases (by
 the way I think this whole thread has been very civilized and i hope is
 stays that way).  Invariably the benchmark has missed some critical idea
 or optimization which drastically skew the results.

  Your recommendation is to pick a DB best suited to your app. But How ??
  a) Either by hiring a guru who has seen all kinds of apps with different
DBs
  who can give you the answer with which we can run
  b) Run a benchmark on critical programs which represent you app across
  databases and find what performs best.
  I've read too much literature on DB features. All DBs have all features
  (except MySQL which does not have commit )
  You can't make a thing out of DB literature.

 What I would recommend is exactly what you have done in this case.  Get
 access to any and all the systems that you feel may do the job for you ,
 and try them out.  Browse the web for other users experiences, but don't
 use other peoples benchmarks, because the odds are good that they are
 wrong...  Create your own, or modify an existing one,