Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Xqh7N-0007nd-H1 for pgsql-bugs@arkaria.postgresql.org; Tue, 18 Nov 2014 11:38:45 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Xqh7M-0001tz-Fc for pgsql-bugs@arkaria.postgresql.org; Tue, 18 Nov 2014 11:38:44 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Xqh7L-0001ts-Fp for pgsql-bugs@postgresql.org; Tue, 18 Nov 2014 11:38:43 +0000 Received: from mail-wg0-x22c.google.com ([2a00:1450:400c:c00::22c]) by magus.postgresql.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1Xqh7G-0003zV-M4 for pgsql-bugs@postgresql.org; Tue, 18 Nov 2014 11:38:42 +0000 Received: by mail-wg0-f44.google.com with SMTP id b13so902639wgh.17 for ; Tue, 18 Nov 2014 03:38:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=w0dfDyKoYk1fOM5l5bo19ohrjV+1GFUP6ExkB6NOFYs=; b=gdiQsSET1lsRBMkXV2KEQCyh6yKzSyht6Mfu0OKw1mAqtxP1kYsVOklnmkCIajCOgg zAv5ZAnxy1aKJcVwZHjrkdRBLFNoSgWYsOstD9FXBi/IyQRXxZxZxgl6BKLWsoTHjo/y t3kPGUxkFg/9TkGljzNroog1yPY0Us/0B6bLDE9S1YdtyX8ElLlBj+qeIV/W1tQuHjn0 Toih1JBXcAJqfZ0hiQpxWGO3DFb+3X1IbFYmsE2Z03gIN/jVvBFjyk61KZunNZioLbLx KEs0E0qhXGGGrJNwRvO3GMyD2xXZN/RtK0KAoaxWVRLrjgwj+T4+wX9v1QSxAMWtzKwc 9dtg== X-Received: by 10.194.156.201 with SMTP id wg9mr30639825wjb.59.1416310717884; Tue, 18 Nov 2014 03:38:37 -0800 (PST) Received: from localhost (ip-46-232-148-34.static.adsl.cheapnet.it. [46.232.148.34]) by mx.google.com with ESMTPSA id wl1sm55472305wjb.4.2014.11.18.03.38.36 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 18 Nov 2014 03:38:37 -0800 (PST) Date: Tue, 18 Nov 2014 12:38:34 +0100 From: Sandro Santilli To: pgsql-bugs@postgresql.org Subject: auto_explain makes CREATE EXTENSION unusable Message-ID: <20141118113834.GB8195@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Pg-Spam-Score: -2.6 (--) 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 Running 'CREATE EXTENSION postgis' on my machine after enabling auto_explain results in the process writing gigabytes of logs keeping the CPU busy for tens of minutes. RhodiumToad on IRC explained to me: < RhodiumToad> the extension script code doesn't split the script into statements itself, it passes the whole thing to the raw parser and gets back a list of statements As a result, each INSERT statement found in the PostGIS extension script results in the whole extension script (including copyright notices!) being dumped in the logs ("Query Text:"). It is also impossible to know which actual statement the plan refers to as always the same full script is dumped. PostGIS has ~4k INSERT statements in its extension script. While the CREATE EXTENSION statement would take under one second to complete with auto_explain disabled, here's the state of my machine at this very moment, with auto_explain enabled: PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 8905 strk 20 0 4637680 186348 62448 R 99.5 1.1 14:41.26 postgres: strk dbtopo [local] CREATE EXTENSION -rw------- 1 strk strk 10228477364 Nov 18 12:37 /tmp/pg93.log It's been running for almost 15 minutes now, and filling up the logfile. Could this be considered a bug in auto_explain ? --strk; () Free GIS & Flash consultant/developer /\ http://strk.keybit.net/services.html -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs