# Disabling/cachine SHOW FIELDS FROM

**URL:** <https://www.ruby-forum.com/t/disabling-cachine-show-fields-from/110788>\
**Category:** Rails\
**Created:** [July 30, 2007, 11:15pm UTC](https://www.ruby-forum.com/t/disabling-cachine-show-fields-from/110788 "2007-07-30T23:15:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joel\_O](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/f04885/32.png) [@Joel\_O](https://www.ruby-forum.com/u/Joel_O)\
**Post date:** [July 30, 2007, 11:15pm UTC](https://www.ruby-forum.com/t/disabling-cachine-show-fields-from/110788/1 "2007-07-30T23:15:00Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Joel\_O](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/f04885/32.png) [@Joel\_O](https://www.ruby-forum.com/u/Joel_O)\
**Post date:** [July 30, 2007, 11:19pm UTC](https://www.ruby-forum.com/t/disabling-cachine-show-fields-from/110788/2 "2007-07-30T23:19:00Z")

</div>

> 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/](http://rimantas.com/)

---

<div class="post-metadata">

**Author:** ![Joel\_O](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/f04885/32.png) [@Joel\_O](https://www.ruby-forum.com/u/Joel_O)\
**Post date:** [July 31, 2007, 3:38am UTC](https://www.ruby-forum.com/t/disabling-cachine-show-fields-from/110788/3 "2007-07-31T03:38:19Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Joel\_O](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/f04885/32.png) [@Joel\_O](https://www.ruby-forum.com/u/Joel_O)\
**Post date:** [July 31, 2007, 4:32am UTC](https://www.ruby-forum.com/t/disabling-cachine-show-fields-from/110788/4 "2007-07-31T04:32:23Z")

</div>

> 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/](http://rimantas.com/)
