I'd put them in a model and call them via cron, e.g.
# in app/models:
class SlowQuery < ActiveRecord::Base
def self.some_query
self.connection.execute "my big slow SQL here"
end
end
cron can call:
ruby script/runner "SlowQuery.some_query"
On Oct 19, 10:26 pm, Robert Matei <[email protected]>
wrote:
> Should note that I already have delayed_job running, but it seems a bit
> silly to create a job (in the database) that just executes a SQL query,
> even if the SQL query is running take significantly longer than creating
> the job.
>
> Robert Matei wrote:
> > There has to be something like this... I have some tracking related SQL
> > queries that are slow and don't need to happen in the request cycle. Is
> > it possible to dump them to some text file and then read them in a
> > daemon and send them to MySQL?
>
> > What would be the simplest way of implementing this?
>
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---