I'm reading documentation for SPI https://www.postgresql.org/docs/13/spi.html And I have a few questions:
- is there any way to use multithreading in C to connect to Postgres (via SPI or Libpq) and read data from one table? (for example, one thread reads data from 1 to 100 rows, second from 101 to 200 etc).
- I know that Postgres can use workers (for SELECT, for example), but how SPI will react to that (if I send command "select * from table_name")
LIMITandOFFSET... so it should be easy to route different subsets of a query to different threads. I'm not sure how (if) it will improve performance, that would depend on specific use cases.