On March 21, 2002 10:37 am, darren chamberlain wrote:
> Quoting Dave Hodgkinson <[EMAIL PROTECTED]> [Mar 21, 2002 13:25]:
> > darren chamberlain <[EMAIL PROTECTED]> writes:
> > > Quoting dreamwvr <[EMAIL PROTECTED]> [Mar 21, 2002 13:10]:
> > > > Is there any issue with using modperl with postgres vs mysql
> > > > for a database driven website? Don't want to bark up the wrong
> > > > tree in a mod_perl project only to discover I picked the wrong
> > > > .db :-/
> > >
> > > Take a look at
> > > <URL:http://www.phpbuilder.com/columns/tim20000705.php3>, in which the
> > > author discusses why Sourceforge uses postgresql
> > > instead of MySQL.  It's a little dated (the postgres version is
> > > 7.1, for example) but a fun read.

Note that a couple of his assertions in this document would be rather naive.

The first one I noted was that he assumes that a high performance app has 
several joins. I think everyone here who's developed a few db apps will tell 
you that joins are hugely costly and should be avoided for an application's 
most common cases. 

I recoded a mysql/mod_perl web app with a couple of joins to a slightly but 
not horridly denormalized db structure and realized some huge performance 
gains. 

Further on, he was discussing threaded discussion forums and assumed a 
recursive query. While recursing the DATA is probably (though provabably not 
always) necessary, there is no need to storm the db with that many queries, 
since query setup time, queing, and results extraction have noticable time 
penalties. Extracting the data with a single query and recursing it in RAM is 
a much more db and cpu friendly idea. 

So is time dependent caching. How many inserts into a table per second do you 
expect? For your average discussion thing, maybe one new comment per minute. 
With a one minute cache on the db data, suddenly your speed limits are 
removed. Why would you need to requery the db if you don't expect it to 
change? This is the joy of mod_perl, being able to keep some context of your 
_application_ between hits of your _users_.


As for performance, mysql and postgresql are getting pretty similar results, 
_these_ days. With aggressive app level caching of db data, and the innodb 
table handler, I was able to push mysql and mod_perl to 80+ 50kbyte page 
views per second on bog standard 650 mhz intel hardware. 

-- 
Jay "yohimbe" Thorne  [EMAIL PROTECTED]
Mgr Sys & Tech, Userfriendly.org

Reply via email to