TL; DR: Is there anyway to query a postgres instance for how many cores it has available for processing?
Postgres has a good reputation with respect to parallelizing multiple queries efficiently across available cores.
I'm writing an application with a CPU intensive data transformation pipeline to be executed by postgres on a large number of collections of source data. Each pipeline will be the work of a single connection, and I hope to exploit parallelism by establishing multiple Connections and performing the work (which occurs in temporary tables scoped within single Connections).
I'd like to tune how many concurrent Connections to maintain with the database. My inclination is to use a multiplier over available cores, something like 1.5x, in order not to bog down the DBMS with waiting Connections but still ensure that it always has work to do.
However, the DBMS will be an AWS RDS instance selected by users. I don't know in advance how many cores will be available. Is there anyway to query the database to find out?