I am using delayed_job and delayed_job_active_record for back ground job execution in my rails application. We are using queue based delayed_job. For starting the delayed I am u
So this is a query specifically designed for Postgres. Please refer to https://github.com/collectiveidea/delayed_job_active_record/blob/master/lib/delayed/backend/active_record.rb#L57 for why it has to be like that.
The idea of delayed job is indeed that it will query the db periodically, so the query in your question is expected to be fired as long as the worker is running. This should happen every second and I can't imagine that this has significant influence on the performance of your app.
Are you running on very limited hardware like a very small virtual machine?