Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VZ4Q4-0004qv-Pu for pgsql-bugs@arkaria.postgresql.org; Wed, 23 Oct 2013 19:48:40 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VZ4Q4-0001jV-8v for pgsql-bugs@arkaria.postgresql.org; Wed, 23 Oct 2013 19:48:40 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VZ4Q3-0001j7-8Z for pgsql-bugs@postgresql.org; Wed, 23 Oct 2013 19:48:39 +0000 Received: from mail.gransy.com ([2001:1528:137::f1]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VZ4Px-0007xc-Lg for pgsql-bugs@postgresql.org; Wed, 23 Oct 2013 19:48:36 +0000 Received: from antispam.gransy.com (antispam.gransy.com [77.78.104.124]) by mail.gransy.com (Postfix) with ESMTP id AD0D0508C72 for ; Wed, 23 Oct 2013 21:48:28 +0200 (CEST) X-Virus-Scanned: G-Hosting.cz + Station.cz + Klenot.cz + Subreg.cz amavisd-new at antispam.gransy.com Received: from mail.gransy.com ([82.208.44.189]) by antispam.gransy.com (antispam.gransy.com [77.78.104.124]) (amavisd-new, port 10024) with ESMTP id FEKcglmXhH1g for ; Wed, 23 Oct 2013 21:48:39 +0200 (CEST) Received: by mail.gransy.com (Postfix, from userid 5000) id C53D4508C77; Wed, 23 Oct 2013 21:48:27 +0200 (CEST) Received: from [192.168.1.227] (ip-78-45-139-138.net.upcbroadband.cz [78.45.139.138]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.gransy.com (Postfix) with ESMTPSA id A2D79508C72 for ; Wed, 23 Oct 2013 21:48:27 +0200 (CEST) Message-ID: <5268280B.2010204@fuzzy.cz> Date: Wed, 23 Oct 2013 21:48:27 +0200 From: Tomas Vondra User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.0 MIME-Version: 1.0 To: pgsql-bugs@postgresql.org Subject: Re: crazy logging from PG 8.4 References: <4b1a3cc650d1ab10de13360bf2222dc2.squirrel@sq.gransy.com> <28141.1382540089@sss.pgh.pa.us> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org On 23.10.2013 20:56, Jon Nelson wrote: > On Wed, Oct 23, 2013 at 9:54 AM, Tom Lane wrote: >> "Tomas Vondra" writes: >>> On 23 Říjen 2013, 16:00, Jon Nelson wrote: >>>> After several days of running a simple query over a very large dataset >>>> (more than a terabyte), I logged in to note that postgresql had >>>> decided to log *billions* of log lines. >> >>> First guess is that you enabled detailed logging in config. >> >> I think it's trace_sort. > > I think you are right. > > Let's say that there would end up being 2.7+ billion groups. Does > that scenario help to explain? I guess I'd like to see trace_sort have > a new value in addition to just "on" and "off", perhaps "external". I > don't really care about internal sorts but I do care about external > sorts. Right now, they're the only (minimal!) insight I have into how > the query is progressing. Yes, that sounds plausible, because COUNT(DISTINCT) ends with a sort for each group. At least that's my experience. If by internal/external you mean in-memory/on-disk sorting, then you can disable trace_sort and use log_temp_files instead. It will probably log some other operations using temp files, but it's unlikely to happen as frequently as trace_sort. Tomas -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs