Re: [Maypole] Maypole responding to requests very slowly (or, how to get just one associated record instead of getting the world)

From: Simon Cozens (simon at simon-cozens.org)
Date: Thu Sep 30 2004 - 07:48:02 BST


Tony Bowden:
> On Wed, Sep 29, 2004 at 12:48:16PM -0400, Brian Glass wrote:
> > What's happening is that Maypole is sucking down every row in the
> > account table to fill the $classmetadata->{cgi} structure.
> > I'm hoping the Maypole gods already have a solution for this problem... ;)
>
> as I said earlier, this is usually a sign that your Essential columns is
> too narrow.

No, I think in this case, it's Class::DBI::AsForm doing the wrong thing.
There ought to be some kind of cut-off for when it turns a has-a into a
SELECT element; you probably don't want a 50,000 option SELECT, ever,
not least if you're never going to use it.

Perhaps the solution is for AsForm to return its own objects, which save state
and only hit the database when as_HTML is called on them.

The alternative is to take the 'cgi' bit out of the class metadata, and have
AsForm add methods into each model class, so you'd call
    beer.as_form("breweries").as_HTML
if you needed it.

-- 
"Consider a spherical bear, in simple harmonic motion..."
		-- Professor in the UCB physics department

_______________________________________________ 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