News for hackers. Stuff that matters.
Re:The Internals of PostgreSQL by outworlder on Wednesday January 26, 2022 @05:28PM (#30093014)
> So, Postgres is using process-per-connection model. Can some explain why this is? And why not something like thread-per-connection?

Thread vs process under Linux is kind of a potato potato thing. They are essentially the same thing - based on the flags provided when you create the process, you can indicate if you want things like shared memory or not. But they are ultimately the same construct, with similar overhead. Plus, fork() is incredibly useful.

It makes sense, for such an important piece of software, to minimize shared memory.

Re:The Internals of PostgreSQL by mike_hock on Wednesday January 26, 2022 @07:30PM (#30094298)
Also, Postgres predates CLONE_THREAD, so when Postgres was created, the distinction was even more potato-potahto than it is today.
Re:The Internals of PostgreSQL by boomer918 on Thursday January 27, 2022 @12:14AM (#30096493)
Are you certain? I thought threads are much more lightweight and also access memory faster because there is no CoW overhead (mutexes permitting).

E.g. why nginx is much faster and lighter than Apache and MySQL connections are cheaper and faster to create than Pg.