Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DelaydJob SQL request are very slow #24

Open
mikhailov opened this issue Mar 18, 2010 · 4 comments
Open

DelaydJob SQL request are very slow #24

mikhailov opened this issue Mar 18, 2010 · 4 comments

Comments

@mikhailov
Copy link

NewRelic RPM show me the DelaydJob SQL request as very slow. MySQL Slow Query Log does the same.
What exactly column should be indexed? single or multiple columns indexes?
Does anybody do an analysis?

@mikhailov
Copy link
Author

I have found an interested article, Tobi, please take a look, can it help?
http://www.elevatedcode.com/articles/2009/11/04/speeding-up-delayed-job/

@jsuchal
Copy link

jsuchal commented Mar 18, 2010

You need this. http://github.com/collectiveidea/delayed_job/commit/c743446a31fe5683544b78e9bf86dec371923b38

Depending on which database you use there are different solutions:

  • with MySQL you should reverse priority order and create a composite[:priority, :run_at],
  • with Postgres you should create a composite index with different order on both columns priority DESC, run_at ASC.

Hope this helps.

BTW I am using the former "method" with thousands of jobs in table with no problem.

@mikhailov
Copy link
Author

Great thanks! But I'm using of gem instead of plugin.
Is it possible to pull request to official version?

@jsuchal
Copy link

jsuchal commented Mar 18, 2010

You can also use it as a gem. Just look at README http://github.com/collectiveidea/delayed_job#readme

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants