In production mode you should see only one SHOW FIELDS command for
every table used. Rails caches column information ... at least in
theory. In practice caching has a small bug in the last release.
Problem was first noticed by Stefan Kaes in his #912 performance
patch, so probably next release will not have this issue.
Zsombor
On 6/23/05, David Teare
<dteare-LXYvB7aEQDJCkLs28/y7ANBPR1lH4CV8@public.gmane.org>
wrote:> Rails caches the fields automatically when running in a production
> environment. I have, however, found that Rails continues to use SHOW
FIELDS
> every time you create a new model instance.
>
> i.e. Every time I perform "u = User.new" I see a SHOW FIELDS sql
being
> executed on the user table.
>
> Does anyone know why this is the case? Shouldn''t Rails be caching
the
> fields in this case? Amazingly, whenever I perform a User.find_by, no SHOW
> FIELDS is used!
>
>
>
> On 22-Jun-05, at 1:23 PM, jbd-ARXITx83Qt49fbuuu1rVSg@public.gmane.org
wrote:
>
>
> How does one get Rails to cache fields in AR?
>
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
>
>
--
http://deezsombor.blogspot.com