Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Vn67C-00080x-Ss for pgsql-performance@arkaria.postgresql.org; Sun, 01 Dec 2013 12:27:11 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Vn67C-0005xn-BE for pgsql-performance@arkaria.postgresql.org; Sun, 01 Dec 2013 12:27:10 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Vn67A-0005vw-GA for pgsql-performance@postgresql.org; Sun, 01 Dec 2013 12:27:08 +0000 Received: from mailout02.ims-firmen.de ([213.174.32.97]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Vn677-0000eh-CV for pgsql-performance@postgresql.org; Sun, 01 Dec 2013 12:27:07 +0000 Received: from mailin01.ims-firmen.de ([192.168.1.141]) by mailout02.ims-firmen.de with esmtp (envelope-from ) id 1Vn675-0008K5-l5 for pgsql-performance@postgresql.org; Sun, 01 Dec 2013 13:27:03 +0100 Received: from [87.170.136.132] (helo=a-kretschmer.de) by mailin01.ims-firmen.de with esmtpsa (TLSv1:AES256-SHA:256) (envelope-from ) id 1Vn675-0003fc-1F for pgsql-performance@postgresql.org; Sun, 01 Dec 2013 13:27:03 +0100 Received: from kretschmer by a-kretschmer.de with local (Exim 4.69) (envelope-from ) id 1Vn674-0006q7-70 for pgsql-performance@postgresql.org; Sun, 01 Dec 2013 13:27:02 +0100 Date: Sun, 1 Dec 2013 13:27:02 +0100 From: Andreas Kretschmer To: pgsql-performance@postgresql.org Subject: Re: Speed up the query Message-ID: <20131201122702.GA26157@tux> References: <20131201071231.GA4780@tux> <335A179F-B1A5-4634-998F-BA30ACD84209@gmail.com> <20131201083541.GA10012@tux> <980E5A18-104B-46C8-AB98-A66A391C8272@gmail.com> <529B265B.5030206@gmx.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <529B265B.5030206@gmx.net> X-OS: Debian/GNU Linux - weil ich es mir Wert bin! X-GPG-Fingerprint: EE16 3C01 7B9C 10F7 2C8B 3B86 4DB3 D9EE 7F45 84DA X-Message-Flag: "Windows" is not the answer. "Windows" is the question and the answer is "no"! X-Lugdd: Gerd Kube X-Info: My name is root. Just root. And I am licensed to kill -9 User-Agent: Mutt/1.5.18 (2008-05-17) X-Pg-Spam-Score: -1.9 (-) 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 Torsten Förtsch wrote: > I'd try 2 things: > > 1) set work_mem to ~100Mb. You don't have to do that globally in > postgresql.conf. You can set it for the current session only. > > set work_mem to '100MB'; > > Then run your query. > > 2) change the common table expression to a subquery: Yeah, agree. Andreas -- Really, I'm not out to destroy Microsoft. That will just be a completely unintentional side effect. (Linus Torvalds) "If I was god, I would recompile penguin with --enable-fly." (unknown) Kaufbach, Saxony, Germany, Europe. N 51.05082°, E 13.56889° -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance