You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
collectiveidea#143
> The subquery returns 1 row so there is no need to use "IN" as the "=" operator will work just fine. Additionally, using "=" doesn't allow the query planner to choose a plan that can sidestep the LIMIT.
Hi we are using delayed_jobs_active_record 4.1.1 with PostgreSQL 9.6.
We can see that PostgreSQL is updating multiple record in some cases here: https://github.com/collectiveidea/delayed_job_active_record/blob/master/lib/delayed/backend/active_record.rb#L100. We can actually see that there are multiple records updated and returned by the
UPDATE...RETURNING *
query .The problem is somewhat described here https://dba.stackexchange.com/questions/69471/postgres-update-limit-1/69497#comment321713_69497 , and basically is that the postgresql planer sometimes decides not to see the limit in the sub-query and uses JOIN which updated all the records that matches the predicates in the sub-query.
Hope this helps.
The text was updated successfully, but these errors were encountered: