3 ms·
> So, Postgres is using process-per-connection model. Can some explain why this is? And why not something like thread-per-connection? This is explained in thei
by hans_castorp 5y ago
> So, Postgres is using process-per-connection model. Can some explain why this is? And why not something like thread-per-connection?
This is explained in their Wiki "Things we do NOT want"
https://wiki.postgresql.org/wiki/Todo#Features_We_Do_Not_Want https://wiki.postgresql.org/wiki/Todo#Features_We_Do_Not_Wan...
> All backends running as threads in a single process (not wanted)
> This eliminates the process protection we get from the current setup. Thread creation is usually the same overhead as process creation on modern systems, so it seems unwise to use a pure threaded model, and MySQL and DB2 have demonstrated that threads introduce as many issues as they solve. Threading specific operations such as I/O, seq scans, and connection management has been discussed and will probably be implemented to enable specific performance features.
- dmw_ng 5y agoYou can actually find some dissent from one of the core team in the linked thread: https://www.postgresql.org/message-id/CA%2BTgmobuHESqa%3Db5ssoKmoNhHXRQ5KHsfAB0RknvZh%2Bf_Rbt2g%40mail.gmail.com https://www.postgresql.org/message-id/CA%2BTgmobuHESqa%3Db5s... Modern PG is already threaded out of necessity for many kinds of query, there's really no other way to fully exploit modern hardware (or indeed, much of the hardware released in the past 30 years).