Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WkJFk-0006Ub-3G for pgsql-performance@arkaria.postgresql.org; Tue, 13 May 2014 20:24:44 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WkJFj-0002c3-Ib for pgsql-performance@arkaria.postgresql.org; Tue, 13 May 2014 20:24:43 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WkJFi-0002bw-C2 for pgsql-performance@postgresql.org; Tue, 13 May 2014 20:24:42 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WkJFg-0005hF-AH for pgsql-performance@postgresql.org; Tue, 13 May 2014 20:24:41 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id s4DKOdas027719; Tue, 13 May 2014 16:24:39 -0400 From: Tom Lane To: Tim Kane cc: "pgsql-performance@postgresql.org" Subject: Re: Constraint exclusion won't exclude parent table In-reply-to: References: Comments: In-reply-to Tim Kane message dated "Tue, 13 May 2014 21:02:16 +0100" Date: Tue, 13 May 2014 16:24:39 -0400 Message-ID: <27718.1400012679@sss.pgh.pa.us> X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org Tim Kane writes: > So what is the append node actually doing, and why is it necessary? > I expect that it simply does what it says, and appends the results of those > two seq-scans. But in reality, there isn’t a lot to do there. While I > expect a little bit of overhead, surely it just passes the tuples straight > through to the result node and that will be that.. No? Yeah, it's not expected that that's going to cost much. I am suspicious that what you are looking at is mostly measurement overhead: during EXPLAIN ANALYZE, each plan node has to do two gettimeofday() calls per call, and there are lots of platforms where that is significant relative to the actual work done per node. You might try comparing the overall times for select count(*) from ... rather than EXPLAIN ANALYZE for these two cases. If those times are much closer together than what you're getting from EXPLAIN ANALYZE, then you've got a machine with expensive gettimeofday() and you have to take your measurements with an appropriate quantum of salt. regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance