Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bcs30-0003l5-Tv for pgsql-performance@arkaria.postgresql.org; Thu, 25 Aug 2016 10:38:11 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bcs30-000381-AI for pgsql-performance@arkaria.postgresql.org; Thu, 25 Aug 2016 10:38: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_2) (envelope-from ) id 1bcs1K-0001Gr-V6 for pgsql-performance@postgresql.org; Thu, 25 Aug 2016 10:36:27 +0000 Received: from mailout01.ims-firmen.de ([213.174.32.96]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bcs1H-0007mR-5a for pgsql-performance@postgresql.org; Thu, 25 Aug 2016 10:36:25 +0000 Received: from mailin02.ims-firmen.de ([192.168.1.142]) by mailout01.ims-firmen.de with esmtp (envelope-from ) id 1bcs1E-0006Ma-gH for pgsql-performance@postgresql.org; Thu, 25 Aug 2016 12:36:20 +0200 Received: from [217.235.252.100] (helo=a-kretschmer.de) by mailin02.ims-firmen.de with esmtpsa (TLSv1:AES256-SHA:256) (envelope-from ) id 1bcs1D-0004nW-5q for pgsql-performance@postgresql.org; Thu, 25 Aug 2016 12:36:20 +0200 Received: from kretschmer by a-kretschmer.de with local (Exim 4.69) (envelope-from ) id 1bcs1D-0004WW-AM for pgsql-performance@postgresql.org; Thu, 25 Aug 2016 12:36:19 +0200 Date: Thu, 25 Aug 2016 12:36:19 +0200 From: Andreas Kretschmer To: pgsql-performance@postgresql.org Subject: Re: Slow query with big tables Message-ID: <20160825103619.GA14979@tux> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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: -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 Tommi Kaksonen wrote: > ---Version--- > PostgreSQL 9.2.1, compiled by Visual C++ build 1600, 64-bit current point release for 9.2 is 9.2.18, you are some years behind. The plan seems okay for me, apart from the on-disk sort: increase work_mem to avoid that. If i where you i would switch to PG 9.5 - or wait for 9.6 and parallel execution of aggregates. Regards, Andreas Kretschmer -- Andreas Kretschmer http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance