Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 83A019F96F1 for ; Sat, 11 Aug 2007 04:43:19 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 91996-06 for ; Sat, 11 Aug 2007 04:43:14 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from mu-out-0910.google.com (mu-out-0910.google.com [209.85.134.187]) by postgresql.org (Postfix) with ESMTP id 6EBB89F96EC for ; Sat, 11 Aug 2007 04:43:14 -0300 (ADT) Received: by mu-out-0910.google.com with SMTP id i10so1402004mue for ; Sat, 11 Aug 2007 00:43:12 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:user-agent:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding:sender; b=PSe9TFgm1gKf6meYr0iiYhOAGke2SqbIPdEcRlTco/TEhv8uEjEd/5ujDSNENsoczZpwfA58VEY8ZZWkX7EhmoFiNYHbjgEusNiq+dsBThiXZqqfAkoYhr38oGZxiy/bWeQAyiYt0cB+FjHpqMHd5wv/Uui0M/n0Bw5cZ6QY+uQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:user-agent:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding:sender; b=FAp3tqMKBwjynUcM6NbnjZ37ZMpn+QgTjPhGMX5PXfGoHYq6Wr02wPAcQXUbdmdyTP9ZPWS8LpFoX+iOdwOh1Rto5+l7ayFs/cRJLqKhjCmvcLOCd/nXohcn6swWo84IBhZ0TPWe3Z65HWCql2EuA8hwhJ34Z+QU8cKH/ZlDzQM= Received: by 10.86.81.8 with SMTP id e8mr2948775fgb.1186818191902; Sat, 11 Aug 2007 00:43:11 -0700 (PDT) Received: from ?192.168.0.199? ( [80.222.48.97]) by mx.google.com with ESMTPS id p38sm7031658fke.2007.08.11.00.43.09 (version=SSLv3 cipher=RC4-MD5); Sat, 11 Aug 2007 00:43:10 -0700 (PDT) Message-ID: <46BD687E.1040100@enterprisedb.com> Date: Sat, 11 Aug 2007 08:42:54 +0100 From: Heikki Linnakangas User-Agent: Icedove 1.5.0.10 (X11/20070329) MIME-Version: 1.0 To: pgsql-sql , postgresql performance list Subject: Re: Performance on writable views References: <20070808124054.GC27936@nibiru.local> In-Reply-To: <20070808124054.GC27936@nibiru.local> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200708/121 X-Sequence-Number: 26251 Enrico Weigelt wrote: > I'm often using writable views as interfaces to clients, so > they only see "virtual" objects and never have to cope with > the actual storage, ie. to give some client an totally > denormalized view of certain things, containing only those > information required for certain kind of operations. > > This method is nice for creating easy and robust client > interfaces - internal schema changes are not visible to > the client. In situations when many, many clients - often > coded/maintained by different people - have to access an > database which is still under development (typical for > many inhouse applications), it helps to circument interface > instabilities. > > Now I've got the strange feeling that this makes updates > slow, since it always has to run the whole view query to > fetch an record to be updated (ie. to get OLD.*). There is some overhead in rewriting the query, but it shouldn't be significantly slower than issuing the statements behind the view directly. I wouldn't worry about it, unless you have concrete evidence that it's causing problems. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com