3 ms·
I've tried this, but we ran into high CPU usage while the task was being run, causing other queries to time out or be delayed. Is there a way to send low prior
by itake 4y ago
I've tried this, but we ran into high CPU usage while the task was being run, causing other queries to time out or be delayed.
Is there a way to send low priority updates that wont interfere with other requests?
- jaggederest 4y agoDepends on whether you have access to the underlying system - postgres queries run in processes per-query so you can renice the process, or you can do similar things in C with extensions. But not out of the box or on something like RDS - then your best bet is to write a script or function that uses sleep or pg_sleep to wait between calls to the database - I tend to do it in the database itself by using `CREATE FUNCTION` to write it, but depending on your comfort with postgres it may be better to do it in a scripting language or shell script (as in the parent article using a background job)
- brasic 4y ago> processes per-query Minor nit, this is probably what you meant but it’s process per _connection_.