25 January 2012

Don't Thread On Me

This thread was mentioned in a performance sub-group posting. Give it a read.

Back? It means, so far as I can see, that PG is toast. It will fall down to being the cheap and dirty alternative to MySql, which even has, at least two, multi-threaded engines. DB2 switched it's *nix engine to threads from processes with release 9.5. Oracle claims it for releases going back to 7 (I haven't tried to determine which parts or applications; Larry has bought so many tchochtkes over the years...). SQL Server is threaded.

Given that cpu's are breeding threads faster than cores, PG will fall into irrelevance. Too bad, it's kind of a nice database.

4 comments:

Anonymous said...

The author of that post apparently doesn't understand that even though postgresql hasn't 'switched to threads', it can still do more than one thing at once. Each process is itself an execution thread. A multi-threaded query planner is perfectly possible in postgresql architecture -- however each one must reside in it's own process and you have to use shared memory instead instead of pthreads and locking. Big whoop. The only thing at stake with a multi threaded planner is optimizing single user tasks which is, while important, a niche optimization. PostgreSQL is for more scalable than mysql for multi-user loads and the gap is increasing.

Anonymous said...

The author also has not understood that Oracle runs multiple processes just like PostgreSQL does - at least on Linux/Unix platforms. Oracle uses a thread model only on Windows.

http://docs.oracle.com/cd/E11882_01/server.112/e25789/process.htm#i16977

Ice Bear's diary said...

hi
wanna say - oracle use process in unix version , and threads in windows version.

And windows version of oracle is mooost slower than unix version.

I think is it not so clear about threads and process as you say.

If RDBMS uses threads - any way them must use the shared memory, becas multithreaded rdbms use lot than one process anyway(more than one cpu core).

This mean using threads is not a unicorn, and depends of concrete realization.

about ms sql server threads - it's not a feature, it's a windows system restriction - windows processes cant use shared memory like a unux. (and this a reason why oracle do the some).

Ice Bear's diary said...

and, if thread crash - them crash the parent process with all other threads in this process.

For the rdbms with lot of calculations (not only read\write) - it's critical restriction.