Output all possible SQL statementes in a Rails Application -


i have inherited medium sized rails application , want try optimize right away. want start database ensure indexes placed need forth. therefore need find out possible sql statements activerecord might make can compare database schema , see immediate optimization can made.

in short: there equivalent rake routes output possible sql templates?

the hard way

the rails development log file should contain of sql used during execution of server. grep file select statements - perhaps getting little smarter using regexp. unfortunately you're unlikely ever able process of information therein


manage exception

a better way use simple monitoring solution alert when request runs (e.g. scout). @ rails log file see if problem related db.


use db tools

most dbs alert via log file somewhere if query runs - mysql example has 'slow queries log'.


Comments

Popular posts from this blog

windows - Why does Vista not allow creation of shortcuts to "Programs" on a NonAdmin account? Not supposed to install apps from NonAdmin account? -

c++ - How do I get a multi line tooltip in MFC -

unit testing - How to mock PreferenceManager in Android? -