[Maypole] VERY poor performance

From: Brian Glass (brian at glassbrian.com)
Date: Wed Sep 29 2004 - 14:27:40 BST


I've been developing an application for a couple months now and it's
been really great. However, just the other day I decided to import a
bunch of data from our current database (we're replacing it with this
Maypole app - hopefully) and voila - Molasses in January.

I turned on logging in MySQL and discovered that a whole scad of
unneccessary selects were being done. Essentially a whole dump of a
table (or 2 or 3) that wasn't even needed for this view class. (not only
that, they were being done row by row as in "select stuff1, stuff2, ...
from address where id = 1; select stuff1, stuff2, ... from address where
id=2; ..."

I ran the Maypole::CLI on it and got into the debugger and tracked it
down to Maypole::View::Base::vars. In this method the $classmetadata
variable is being filled up and wouldn't you know it
$classmetadata->{cgi}. It turns out that my family model class has_a
address (model class) and there happen to be about 1500 addresses now.
So when Maypole::View::Base::vars calls $class->to_cgi it gos out and
gets the entire address table one row at a time and creates a <select>
out of the whole thing.

This is sorta handy when you're doing an edit or add, but when you're
doing a view or list it's not really neccessary. This might be a handy
feature if you have small tables, but it's made my app entirely unusable.

Also, and this may not be a Maypole issue, it would be much faster to
retrieve the table in a single select rather than row by row.

Any suggestions?

_______________________________________________
maypole mailing list
maypole at lists.netthink.co.uk
http://lists.netthink.co.uk/listinfo/maypole



This archive was generated by hypermail 2.1.3 : Thu Feb 24 2005 - 22:25:56 GMT