From: | Decibel! <decibel(at)decibel(dot)org> |
---|---|
To: | Marcelo de Moraes Serpa <celoserpa(at)gmail(dot)com> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Performance question |
Date: | 2007-08-16 14:16:33 |
Message-ID: | 20070816141633.GC54309@nasby.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Thu, Aug 16, 2007 at 08:52:02AM -0300, Marcelo de Moraes Serpa wrote:
> Hello list,
>
> If I've got a trigger that calls a function each time there is a DELETE or
> UPDATE opration on a table in my system, and in this function I retrieve
> some boolean information from another table and based on this information,
> additional code will be ran or not in this function. Could the solely fact
> of calling the function and selecting the data on another table (and the
> trigger on each update and delete on any table) affect the overall db
> performance in a noticiable manner ?
Of course, you're adding at least one extra query to each UPDATE and
DELETE. Plus the overhead of the trigger itself.
The real question is: so what? If you need that logic to happen, you
need it to happen. Unless you'll be updating or deleting scores of rows
a second, I wouldn't worry too much about it.
Remember the first rule of performance tuning: don't. :)
--
Decibel!, aka Jim Nasby decibel(at)decibel(dot)org
EnterpriseDB http://enterprisedb.com 512.569.9461 (cell)
From | Date | Subject | |
---|---|---|---|
Next Message | Douglas McNaught | 2007-08-16 14:20:35 | Re: SELECT ... FOR UPDATE performance costs? alternatives? |
Previous Message | Decibel! | 2007-08-16 14:14:24 | Re: how to get id of currently executed query? |