How can I figure out where all these extra sqlite3 selects are being generated in my rails app?

Posted by radixhound on Stack Overflow See other posts from Stack Overflow or by radixhound
Published on 2010-04-29T07:10:10Z Indexed on 2010/04/29 8:27 UTC
Read the original article Hit count: 159

I'm trying to figure out where a whole pile of extra queries are being generated by my rails app. I need some ideas on how to tackle it. Or, if someone can give me some hints, I'd be grateful.

I get these:

  SQL (1.0ms)    SELECT name
 FROM sqlite_master
 WHERE type = 'table' AND NOT name = 'sqlite_sequence'

  SQL (0.8ms)    SELECT name
 FROM sqlite_master
 WHERE type = 'table' AND NOT name = 'sqlite_sequence'

  SQL (0.8ms)    SELECT name
 FROM sqlite_master
 WHERE type = 'table' AND NOT name = 'sqlite_sequence'

repeated over and over on every request to the DB (as much as 70 times for a single request)

I tried installing a plugin that traced the source of the queries, but it really didn't help at all. I'm using the hobofields gem, dunno if that is what's doing it but I'm somewhat wedded to it at the moment

Any tips on hunting down the source of these extra queries?

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about sqlite