# Profile Database Usage

**URL:** <https://www.ruby-forum.com/t/profile-database-usage/112559>\
**Category:** Rails\
**Created:** [August 20, 2007, 10:38pm UTC](https://www.ruby-forum.com/t/profile-database-usage/112559 "2007-08-20T22:38:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Geoffrey\_W](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/57b2e6/32.png) [@Geoffrey\_W](https://www.ruby-forum.com/u/Geoffrey_W)\
**Post date:** [August 20, 2007, 10:38pm UTC](https://www.ruby-forum.com/t/profile-database-usage/112559/1 "2007-08-20T22:38:22Z")

</div>

I’m assuming it’s possible to see the database usage Rails generates,  
but I’m having trouble finding the correct Google search. I’m looking  
at ActsAsVersioned and ActsAsAudited, and I’d like to be able to see  
the resulting SQL as I perform work on the model, to do a little due-  
diligence on these plugins, but … well, I don’t know how. Pointers  
to information on how I can get this would be great.

(If some of you are from Java backgrounds, I’d be happy with the  
equivalent of a Spy driver, or hibernate’s ‘show sql’ property, or  
something like a profiler with database-transaction hooks – any and  
all of the above).

Thanks!

---

<div class="post-metadata">

**Author:** ![Geoffrey\_W](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/57b2e6/32.png) [@Geoffrey\_W](https://www.ruby-forum.com/u/Geoffrey_W)\
**Post date:** [August 20, 2007, 10:52pm UTC](https://www.ruby-forum.com/t/profile-database-usage/112559/2 "2007-08-20T22:52:23Z")

</div>

On 8/20/07, Geoffrey W. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I’m assuming it’s possible to see the database usage Rails generates,  
> but I’m having trouble finding the correct Google search. I’m looking  
> at ActsAsVersioned and ActsAsAudited, and I’d like to be able to see  
> the resulting SQL as I perform work on the model, to do a little due-  
> diligence on these plugins, but … well, I don’t know how. Pointers  
> to information on how I can get this would be great.

Hi,

How about tailing the current environment’s log file? AR’s generated  
SQL will show up.

~ j.
