Re: Performance on writable views

From: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
To: Heikki Linnakangas <heikki(at)enterprisedb(dot)com>
Cc: pgsql-sql <pgsql-sql(at)postgresql(dot)org>, postgresql performance list <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Performance on writable views
Date: 2007-08-11 13:58:41
Message-ID: 46BDC091.4090109@commandprompt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance pgsql-sql

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Heikki Linnakangas wrote:
> 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.

>> 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.

I don't know about that, at least when using rules for partitioning the
impact can be significant in comparison to triggers.

It may make sense for him to push this stuff to stored procs instead.

Joshua D. Drake

- --

=== The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564 24x7/Emergency: +1.800.492.2240
PostgreSQL solutions since 1997 http://www.commandprompt.com/
UNIQUE NOT NULL
Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate
PostgreSQL Replication: http://www.commandprompt.com/products/

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGvcCRATb/zqfZUUQRAqngAKCKZG1LkeBd6/Qyghv/GzPBp4qCGACfS1Ar
tXJSi/ynIQlAkATIv2yKd7M=
=lYbI
-----END PGP SIGNATURE-----

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Kevin Grittner 2007-08-11 15:32:08 Re: select count(*) performance
Previous Message Heikki Linnakangas 2007-08-11 07:42:54 Re: Performance on writable views

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2007-08-11 15:50:41 Re: Trigger Procedure Error: NEW used in query that is not in a rule
Previous Message Andreas Joseph Krogh 2007-08-11 09:22:08 Re: Index usage in order by with multiple columns in order-by-clause