X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id C1C3CD1B4E1 for ; Fri, 26 Sep 2003 21:32:07 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 27931-02 for ; Fri, 26 Sep 2003 18:31:59 -0300 (ADT) Received: from news.hub.org (unknown [64.117.224.194]) by svr1.postgresql.org (Postfix) with ESMTP id BCD93D1B4ED for ; Fri, 26 Sep 2003 18:31:56 -0300 (ADT) Received: from news.hub.org (host-64-117-224-194.altec1.com [64.117.224.194] (may be forged)) by news.hub.org (8.12.9/8.12.9) with ESMTP id h8QLVuhK069582 for ; Fri, 26 Sep 2003 21:31:56 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id h8QLA0xk066797 for pgsql-sql@postgresql.org; Fri, 26 Sep 2003 21:10:00 GMT From: Christopher Browne X-Newsgroups: comp.databases.postgresql.sql Subject: Re: does postgresql execute unions in parallel? Date: Fri, 26 Sep 2003 16:28:23 -0400 Organization: Hub.Org Networking Services Lines: 33 Message-ID: <604qyz2t20.fsf@dev6.int.libertyrms.info> References: <3F749A83.30001@bigfoot.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@news.hub.org User-Agent: Gnus/5.1003 (Gnus v5.10.3) XEmacs/21.4 (Rational FORTRAN, linux) Cancel-Lock: sha1:5L5HQ8GNVo2gxjkcqlo1IKlKyWw= To: pgsql-sql@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/342 X-Sequence-Number: 15320 mendola@bigfoot.com (Gaetano Mendola) writes: > teknokrat wrote: >> If I have several selects joined with unions does postgresql >> execute the concurrently or not? > > nope. I was talking with Jan about that very idea yesterday; this would seem to be the place where PostgreSQL might take some (possibly even nearly magical :-)) benefit from threading. The usual way that people expect to use threading is for each connection to have a thread. If, instead, every _join_ had a thread, that would allow producers of data to look for their data quasi-independently, passing result sets upwards towards the return set to whatever thread was waiting to consume the data. This would allow one complex query to take over a whole horde of processors :-). The "magic" part would be if the system decided, "The SEQ SCAN on the table I'm looking at is a big one; let's split it into 4 chunks, doing a virtual UNION ALL, and thereby filter bits of it in parallel on 4 CPUs." That would provide many of the benefits Informix claimed from "fragmentation" without having to fragment the table :-). -- If this was helpful, rate me http://www3.sympatico.ca/cbbrowne/lsf.html Rules of the Evil Overlord #187. "I will not hold lavish banquets in the middle of a famine. The good PR among the guests doesn't make up for the bad PR among the masses."