On Wednesday, Feb 19, 2003, at 20:58 Europe/London, Kjetil Kjernsmo wrote:

Hi folks!

This question is slightly OT, since it is more about databases and DBI
than AxKit, but I figured more people must have run into it.

When you code an exists or process sub in a Provider, that check against
a database to see if the entry you're after exists, how do you do
that...?

I mean, this operation may be almost as expensive as retrieving the
entry itself from the database, unless you do something smart...?
So, if you first do an expensive operation to check if you process, and
then do pretty much the same thing again to retrieve the resource, it
seems like a waste... Right now, I've coded it to say "always exists"
and then throw an exception after retrieving the resource, but that is
clearly not the intended way.
Either do "select 1 from ..." which should theoretically be optimised, or load all your data in during init(). Cache wherever possible (I suspect Mike Chamberlain has lots of details on caching, though I don't know if he's still subscribed to this list).


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to