best way to run a periodic query in mysql

In my Rails application I have a separate process (BackgroundRb) to delete all transactions which are not successful and it must be run after every five minutes. But in BackgroundRb, it runs a database check after every second though my query executes periodically at the specified time(after 5 mins). So my question is what is the best approach for this kind of scenario ? Should I use a Stored procedure in which the query is executed inside a infinite loop, not giving burden on Rails application (since BackgroundRb is accessing database at every second) or should I use a different application like Wokling to stop such frequent database access as BackgroundRb does.

This question and answers originated from www.stackoverflow.com
Question by (2/27/2010 10:18:35 AM)

Answer

I'd recommend a separate script run by cron. Cron is present on every hosting.


Find More Answers
Related Topics  mysql  ruby-on-rails  query  run  periodically
Related Questions
  • Best way to add a column in mysql query

    Can any one please let me know that, I need to add a column dynamically when executing mysql query Table: Table1 -------------------------- col1 col2 col3 -------------------------- Test O…
  • best way to query ranges in mysql

    I am designing a query that pull rows from a large table based on parameters expressed as ranges (specifically years). There are some cases where I'll want to pull rows based on 3 specific values (s…
  • Best way to query mysql for total time worked in a day

    I'm trying to come up with the best way to add the total time an employee was clocked in. The punch types are day in, break out, break in & day out . You would think I could just select * whe…
  • MySQL best way to construct this query?

    I've inherited a database that has a structure with a table of products, a table consisting of some product attributes and another table to build the relationship between these attributes and a give…
  • Force periodically_call_remote to fire immediately

    I have a periodically_call_remote that I want to fire right away (as if the code was present without the setTimeout) as well as call periodically. Is there a nice way to do this use PCR, or d…
  • Can we run a mysql query through command prompt in windows?

    Hi can we run mysql query from windows command prompt. If yes how can we do that and how to process the query result through command prompt. Please help me Thanks
  • Is there any way to tell how long a MySQL query will take to run?

    Other than running it to completion... Is there some sort of progress you can monitor to see what operations are happening as your query is being processed that would give you a sense of how long…
  • Best way to check for NULL value in MySql query

    Can any one please let me know the best way to use IF statement in mysql query to show if the "email" field is NULL then it should show as "no email"... Postcode Telephone Email ----------…
  • Best way to use number format in mysql query

    can any one please let me know, i need to set the "Total Price" value to be in two decimal point value like "56.35". Now its showing more fraction values like "56.3566666". I need it to be format it…
  • Best way to turn a MySQL query into an object

    I have a user table that contains a bunch of columns that I want to access in a mysql query for the logged in user. Ultimately, I want the values in these columns to form a User object. Is there a s…