Forum: Ruby on Rails disabling/cachine SHOW FIELDS FROM

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
0df56f2edb0d80e81c5c0ef1ca91690e?d=identicon&s=25 Joel Oliveira (Guest)
on 2007-07-30 23:15
(Received via mailing list)
I ask if this is possible with hopes I can squeeze every last ounce of
optimization from my database(s).

Is there any way to tell rails to cache or not inspect tables with all
of
these "SHOW FIELDS FROM" queries?

I've searched around but haven't come up with anything concrete.  Anyone
have any tips?

- J
Ec5a599777854c540fd102ef4691fe10?d=identicon&s=25 Rimantas Liubertas (Guest)
on 2007-07-30 23:19
(Received via mailing list)
> I ask if this is possible with hopes I can squeeze every last ounce of
> optimization from my database(s).
> Is there any way to tell rails to cache or not inspect tables with all of
> these "SHOW FIELDS FROM" queries?
> I've searched around but haven't come up with anything concrete.  Anyone
> have any tips?

How about running rails in production mode?

Regards,
Rimantas
--
http://rimantas.com/
0df56f2edb0d80e81c5c0ef1ca91690e?d=identicon&s=25 Joel Oliveira (Guest)
on 2007-07-31 03:38
(Received via mailing list)
Rimantas -

Pardon my ignorance, but when in production mode it does NOT make those
queries?   Could you point me to where in the docs this is specified?
Some
colleagues of mine were wondering the same issue and I'd like to point
them
somewhere.

Thanks for the reply.

- Joel
Ec5a599777854c540fd102ef4691fe10?d=identicon&s=25 Rimantas Liubertas (Guest)
on 2007-07-31 04:32
(Received via mailing list)
> Rimantas -
>
> Pardon my ignorance, but when in production mode it does NOT make those
> queries?

It does, but only once, on initial load. In development mode your
model classes get
reloaded on every request.

> Could you point me to where in the docs this is specified?  Some
> colleagues of mine were wondering the same issue and I'd like to point them
> somewhere.

Not sure if this is the best place fot this, but take a look at
config/environments/development.rb and
config/environments/production.rb

development.rb:

# In the development environment your application's code is reloaded on
# every request.  This slows down response time but is perfect for
development
# since you don't have to restart the webserver when you make code
changes.
config.cache_classes = false

production.rb:
# The production environment is meant for finished, "live" apps.
# Code is not reloaded between requests
config.cache_classes = true


Regards,
Rimantas
--
http://rimantas.com/
This topic is locked and can not be replied to.