X-Original-To: pgsql-hackers-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 9B8AC5676E; Mon, 14 Mar 2005 05:00:25 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 72960-05; Mon, 14 Mar 2005 05:00:22 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 5E70056796; Mon, 14 Mar 2005 05:00:14 +0000 (GMT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id j2E50Baw004851; Mon, 14 Mar 2005 00:00:11 -0500 (EST) To: =?windows-1250?Q?Miroslav_=8Aulc?= Cc: pgsql-performance@postgresql.org, pgsql-hackers@postgresql.org Subject: Re: [PERFORM] How to read query plan In-reply-to: <6715.1110758921@sss.pgh.pa.us> References: <42345D24.8070104@startnet.cz> <4234692E.3050802@arbash-meinel.com> <42347407.2000202@startnet.cz> <423478B1.7080106@arbash-meinel.com> <18381.1110741354@sss.pgh.pa.us> <423497FE.6040908@startnet.cz> <19293.1110743673@sss.pgh.pa.us> <42349C96.60401@startnet.cz> <3174.1110745587@sss.pgh.pa.us> <4234AF56.1040509@startnet.cz> <6715.1110758921@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Sun, 13 Mar 2005 19:08:41 -0500" Date: Mon, 14 Mar 2005 00:00:11 -0500 Message-ID: <4850.1110776411@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.007 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200503/419 X-Sequence-Number: 65221 I wrote: > Since ExecProject operations within a nest of joins are going to be > dealing entirely with Vars, I wonder if we couldn't speed matters up > by having a short-circuit case for a projection that is only Vars. > Essentially it would be a lot like execJunk.c, except able to cope > with two input tuples. Using heap_deformtuple instead of retail > extraction of fields would eliminate the O(N^2) penalty for wide tuples. Actually, we already had a pending patch (from Atsushi Ogawa) that eliminates that particular O(N^2) behavior in another way. After applying it, I get about a factor-of-4 reduction in the runtime for Miroslav's example. ExecEvalVar and associated routines are still a pretty good fraction of the runtime, so it might still be worth doing something like the above, but it'd probably be just a marginal win instead of a big win. regards, tom lane