Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZTqdf-0003sw-3y for pgsql-sql@arkaria.postgresql.org; Mon, 24 Aug 2015 12:14:11 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZTqde-0005fH-1b for pgsql-sql@arkaria.postgresql.org; Mon, 24 Aug 2015 12:14:10 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZTqcg-0004XE-72 for pgsql-sql@postgresql.org; Mon, 24 Aug 2015 12:13:10 +0000 Received: from arbun.splivalo.hr ([78.47.9.189]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZTqcd-0000no-NJ for pgsql-sql@postgresql.org; Mon, 24 Aug 2015 12:13:09 +0000 Received: from [192.168.42.12] (cpe-188-252-141-41.zg5.cable.xnet.hr [188.252.141.41]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: mario) by arbun.splivalo.hr (Postfix) with ESMTPSA id D1CE612005A; Mon, 24 Aug 2015 14:13:03 +0200 (CEST) Message-ID: <55DB0A4E.4030600@splivalo.hr> Date: Mon, 24 Aug 2015 14:13:02 +0200 From: Mario Splivalo User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0 MIME-Version: 1.0 To: "Dickson S. Guedes" CC: "pgsql-sql@postgresql.org" Subject: Re: WHERE ... NOT NULL ... OR ... (SELECT...) References: <55DA348D.9050704@splivalo.hr> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.8 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-sql Precedence: bulk Sender: pgsql-sql-owner@postgresql.org On 08/24/2015 01:34 PM, Dickson S. Guedes wrote: > 2015-08-23 18:01 GMT-03:00 Mario Splivalo : >> Unique (cost=193891.55..212017.84 rows=329569 width=162) >> -> Sort (cost=193891.55..194715.47 rows=329569 width=162) > > I'm not answering your original question, but since the queries in your UNION > will be mutually exclusive, you could replace your UNION by UNION ALL to rip off > the Sort+Unique Node. > Good point, thank you! :) Mario -- Mario Splivalo mario@splivalo.hr "I can do it quick, I can do it cheap, I can do it well. Pick any two." -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql