X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id F23F59DCC32 for ; Tue, 21 Mar 2006 16:34:00 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 57952-05 for ; Tue, 21 Mar 2006 16:34:01 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from smtp.nildram.co.uk (smtp.nildram.co.uk [195.112.4.54]) by postgresql.org (Postfix) with ESMTP id E1E649DCBA8 for ; Tue, 21 Mar 2006 16:33:58 -0400 (AST) Received: from [192.168.0.5] (unknown [84.12.26.47]) by smtp.nildram.co.uk (Postfix) with ESMTP id B0A053365F3; Tue, 21 Mar 2006 20:33:55 +0000 (GMT) Subject: Re: WAL logging of SELECT ... INTO command From: Simon Riggs To: "Jim C. Nasby" Cc: pgsql-performance@postgresql.org In-Reply-To: <20060321122211.GU15742@pervasive.com> References: <20060321122211.GU15742@pervasive.com> Content-Type: text/plain Date: Tue, 21 Mar 2006 20:33:50 +0000 Message-Id: <1142973230.24487.501.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.2.3 (2.2.3-2.fc4) Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.095 required=5 tests=[AWL=0.095] X-Spam-Score: 0.095 X-Spam-Level: X-Archive-Number: 200603/425 X-Sequence-Number: 17862 On Tue, 2006-03-21 at 06:22 -0600, Jim C. Nasby wrote: > Currently, it appears that SELECT * INTO new_table FROM old_table logs > each page as it's written to WAL. Is this actually needed? Couldn't the > database simply log that the SELECT ... INTO statement was executed > instead? Doing so would likely result in a large performance improvement > in most installs. Is there no provision for writing anything but data > page changes (or whole pages) to WAL? AFAIK it takes the same code path as CREATE TABLE AS SELECT, which already does exactly what you suggest (except when using PITR). Best Regards, Simon Riggs