DEV Community

Discussion on: How to deal with ActiveRecord::StatementInvalid PG::QueryCanceled?

Collapse
 
_bigblind profile image
Frederik πŸ‘¨β€πŸ’»βž‘οΈπŸŒ Creemers • Edited

I have no experience with anything ruby-related, let alone ActiveRecord, but a quick Google search for "postgres statement timeout" brought me to a page listing connection settings, including statement_timeout. So maybe you can find a way to increase this setting from its default value.

It might also be worth inspecting your query to see if you can optimise it a bit.

Collapse
 
ben profile image
Ben Halpern

I think that's the right thought, but on that note I think decreasing the timeout value is probably more likely to be helpful I think in the macro. This seems to be a symptom of resource over-utilization where quitting early in order to avoid locking things up is probably the right course of action.

Anyway, that's where my head goes.