Re: [HACKERS] Multithread Query Planner

2012-01-30 Thread Robert Haas
On Fri, Jan 27, 2012 at 2:56 PM, Pierre C li...@peufeu.com wrote: Right.  I think it makes more sense to try to get parallelism working first with the infrastructure we have.  Converting to use threading, if we ever do it at all, should be something we view as a later performance optimization.

Re: [HACKERS] Multithread Query Planner

2012-01-28 Thread FredDaniPandora
Ok, thanks. Att, Fred 2012/1/24 Robert Haas robertmh...@gmail.com On Tue, Jan 24, 2012 at 11:25 AM, Tom Lane t...@sss.pgh.pa.us wrote: Robert Haas robertmh...@gmail.com writes: I doubt it. Almost nothing in the backend is thread-safe. You can't acquire a heavyweight lock, a

Re: [HACKERS] Multithread Query Planner

2012-01-27 Thread Pierre C
Not to mention palloc, another extremely fundamental and non-reentrant subsystem. Possibly we could work on making all that stuff re-entrant, but it would be a huge amount of work for a distant and uncertain payoff. Right. I think it makes more sense to try to get parallelism working first

Re: [HACKERS] Multithread Query Planner

2012-01-24 Thread Robert Haas
On Mon, Jan 23, 2012 at 2:45 PM, Merlin Moncure mmonc...@gmail.com wrote: Yes, but OP is proposing to use multiple threads inside the forked execution process.  That's a completely different beast.  Many other databases support parallel execution of a single query and it might very well be

Re: [HACKERS] Multithread Query Planner

2012-01-24 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: I doubt it. Almost nothing in the backend is thread-safe. You can't acquire a heavyweight lock, a lightweight lock, or a spinlock. You can't do anything that might elog() or ereport(). None of those things are reentrant. Not to mention palloc,

Re: [HACKERS] Multithread Query Planner

2012-01-24 Thread Robert Haas
On Tue, Jan 24, 2012 at 11:25 AM, Tom Lane t...@sss.pgh.pa.us wrote: Robert Haas robertmh...@gmail.com writes: I doubt it.  Almost nothing in the backend is thread-safe.  You can't acquire a heavyweight lock, a lightweight lock, or a spinlock. You can't do anything that might elog() or

Re: [HACKERS] Multithread Query Planner

2012-01-23 Thread Yeb Havinga
On 2012-01-13 21:14, Frederico wrote: Hi folks. Is there any restriction in create and start threads inside Postgres? I'm trying to develop a multithread planner, and some times is raised a exception of access memory. I'm debugging the code to see if is a bug in the planner, but until now, I

Re: [HACKERS] Multithread Query Planner

2012-01-23 Thread Merlin Moncure
On Fri, Jan 13, 2012 at 2:29 PM, Christopher Browne cbbro...@gmail.com wrote: On Fri, Jan 13, 2012 at 3:14 PM, Frederico zepf...@gmail.com wrote: Hi folks. Is there any restriction in create and start threads inside Postgres? I'm trying to develop a multithread planner, and some times is

Re: [HACKERS] Multithread Query Planner

2012-01-14 Thread Frederico
This means it's possible use threads? Att, Fred Enviado via iPad Em 13/01/2012, às 20:47, Dimitri Fontaine dimi...@2ndquadrant.fr escreveu: Christopher Browne cbbro...@gmail.com writes: Yes, don't try to use threads.

Re: [HACKERS] Multithread Query Planner

2012-01-14 Thread Dimitri Fontaine
Frederico zepf...@gmail.com writes: This means it's possible use threads? The short answer is “no”. -- Dimitri Fontaine http://2ndQuadrant.fr PostgreSQL : Expertise, Formation et Support -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your

Re: [HACKERS] Multithread Query Planner

2012-01-14 Thread Thomas Munro
On 13 January 2012 20:14, Frederico zepf...@gmail.com wrote: I'm trying to develop a multithread planner, and some times is raised a exception of access memory. I was a bit confused about what you are trying to do -- somehow use concurrency during the planning phase, or during execution (maybe

[HACKERS] Multithread Query Planner

2012-01-13 Thread Frederico
Hi folks. Is there any restriction in create and start threads inside Postgres? I'm trying to develop a multithread planner, and some times is raised a exception of access memory. I'm debugging the code to see if is a bug in the planner, but until now, I still not found. I tried to use the

Re: [HACKERS] Multithread Query Planner

2012-01-13 Thread Christopher Browne
On Fri, Jan 13, 2012 at 3:14 PM, Frederico zepf...@gmail.com wrote: Hi folks. Is there any restriction in create and start threads inside Postgres? I'm trying to develop a multithread planner, and some times is raised a exception of access memory. I'm debugging the code to see if is a bug

Re: [HACKERS] Multithread Query Planner

2012-01-13 Thread Dimitri Fontaine
Christopher Browne cbbro...@gmail.com writes: Yes, don't try to use threads. http://wiki.postgresql.org/wiki/Developer_FAQ#Why_don.27t_you_use_threads.2C_raw_devices.2C_async-I.2FO.2C_.3Cinsert_your_favorite_wizz-bang_feature_here.3E.3F ... threads are not currently used instead of multiple