Re: Patch: plan invalidation vs stored procedures

From: Hannu Krosing <hannu(at)2ndQuadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Asko Oja <ascoja(at)gmail(dot)com>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Dimitri Fontaine <dfontaine(at)hi-media(dot)com>, pgsql-hackers(at)postgresql(dot)org, Andrew Dunstan <andrew(at)dunslane(dot)net>, David Fetter <david(at)fetter(dot)org>, Martin Pihlak <martin(dot)pihlak(at)gmail(dot)com>
Subject: Re: Patch: plan invalidation vs stored procedures
Date: 2008-08-19 10:38:10
Message-ID: 1219142290.7570.20.camel@huvostro
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, 2008-08-18 at 20:29 -0400, Tom Lane wrote:
> "Asko Oja" <ascoja(at)gmail(dot)com> writes:
> > For users of stored procedures it is protection from downtime. For Skype it
> > has been around 20% of databse related downtime this year.
>
> Perhaps Skype needs to rethink how they are modifying functions.

Why not suggest they just should stop using functions and move all
business logic into client or "3rd tier" ?

(Actually I would not recommend that as functions are very good way to
abstract database access AND provide better security AND speed up
queries)

> The reason that this case wasn't covered in 8.3 is that there didn't
> seem to be a use-case that justified doing the extra work. I still
> haven't seen one. Other than inline-able SQL functions there is no
> reason to invalidate a stored plan based on the fact that some function
> it called changed contents.

Maybe there should be something in postgreSQL docs that warns users against
using functions in any non-trivial circumstances, as functions are not
expected to behave like the rest of postgreSQL features and there is
not plan to fix that ?

----------------
Hannu

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2008-08-19 10:42:45 Re: Patch: plan invalidation vs stored procedures
Previous Message Michael Meskes 2008-08-19 10:31:18 Re: ecpg 'set' failure using host vars