I'm trying hard to think of a way to query a database in a fire & forget...

@mistersql

I'm trying hard to think of a way to query a database in a fire & forget fashion. Everything seems to require a live connection until query completion. You can use the `async` keyword, but you can't turn off the machine. (Why? Because I want to avoid paying for wait time in an AWS lambda).

One possible ugly hack: use SQL Agent or pg_cron to schedule a task immediate execution. Poll for completion.

Initial call: 1 ms
(query runs for say, 2 seconds)
Polling 10 times, 1ms each: 10ms

Self-replies

The overhead for creating one time background tasks has to be awful. Alternatively, run a high frequency schedule.

Anyhow, just not a lot of good options for wringing out compute costs for a waiting Lambda.