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. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 3/25/07, Dan Kelley <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > 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.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 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks, Rick. I''m still adjusting to this ActiveRecord idea, and what goes on behind the scenes, and I appreciate the informative reply. Dan. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Just goes to show how invaluable I see this Google Group. On Mar 25, 1:58 pm, Dan Kelley <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Thanks, Rick. I''m still adjusting to this ActiveRecord idea, and what > goes on behind the scenes, and I appreciate the informative reply. Dan. > > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---