Can PostgreSQL index calculations be multithreaded? During a single query write of approximately 300,000 rows with 30 columns all indexed, I noticed that only one core was maxed at a time.

Is there any way to calculate indexes multithreaded for single inserts?
Is there any way to calculate indexes multithreaded for single inserts?


Unfortunately, no.

PostgreSQL backends are single-threaded, and a single connection can use only one backend.

There's work to enhance this, but it's a seriously difficult and big job because of PostgreSQL's process-based architecture.

The only real option is to split the insert its self into multiple concurrent connections, each doing part of the work.