I see that every time I load a page (that lists paginated rows of a database), mysql is told to "SHOW FIELDS FROM (database)". This seems unneccessary to me. (*I* know the fields; *my code* knows the fields!) My guess is that this happens because of something that was in the rails-provided scaffolding, most of which I've replaced by now. Is a way to turn this off? I realize it probably doesn't take a lot of time, but it seems inelegant to send needless queries to the database engine.
on 2007-03-25 12:54
on 2007-03-25 13:23
On 3/25/07, Dan Kelley <firstname.lastname@example.org> wrote: > Is a way to turn this off? I realize it probably doesn't take a lot of > time, but it seems inelegant to send needless queries to the database > engine. Actually, your code doesn't know the fields. Well, ActiveRecord, not *your* code. This only happens in development mode when your classes are reloading (to pick up changes to your schema). In production mode, the SHOW FIELDS query will be called once at startup. -- Rick Olson http://lighthouseapp.com http://weblog.techno-weenie.net http://mephistoblog.com
on 2007-03-25 14:58
Thanks, Rick. I'm still adjusting to this ActiveRecord idea, and what goes on behind the scenes, and I appreciate the informative reply. Dan.
on 2007-03-26 22:37
Just goes to show how invaluable I see this Google Group. On Mar 25, 1:58 pm, Dan Kelley <rails-mailing-l...@andreas-s.net>