Re: Database design and triggers... - Mailing list pgsql-general

From Richard Broersma Jr
Subject Re: Database design and triggers...
Date
Msg-id 20060910204440.30807.qmail@web31802.mail.mud.yahoo.com
Whole thread Raw
In response to Re: Database design and triggers...  (romantercero@gmail.com)
Responses Re: Database design and triggers...  (romantercero@gmail.com)
List pgsql-general
> Hi Brandon,
>
> Thank you for your response.
>
> Yes, I see what you mean when you say that I can list Qty in signed
> integers and use a view. Good point.
>
> But I'm not sure as to using a view vs using a permanent table updated
> by triggers. It seems we are dealing with the clasic tradeoff between
> speed & storage space.
>
> A permanent table would duplicate data and even though it would toll
> write operations I suspect it would be faster than users bringing up a
> view every time they wish to execute a transaction.
>
> Any Sugestions as to which way I should go on the tradeoff and why?

A permanent table updated on triggers sounds like a "Materialized" View.  A view must be process
everytime it is called.  A Materialized view can have its data processed in various ways.
Depending upon your requirements, you can select a materialized view  that will get you what you
want with a smaller preformance hit.
http://jonathangardner.net/PostgreSQL/materialized_views/matviews.html
http://www.varlena.com/varlena/GeneralBits/64.php
http://www.revsys.com/blog/archive/9

pgsql-general by date:

Previous
From: Dino Vliet
Date:
Subject: Re: execute in pl/pgsql
Next
From: Jean-Gerard Pailloncy
Date:
Subject: Certificate, login & php question ?