On Mon, 20 Apr 2009, RB wrote:

> On Mon, Apr 20, 2009 at 11:47, Rainer Gerhards <[email protected]> 
> wrote:
>> The real issue, as I see it, is "string vs. API call". Your sample above is
>> API-call, and this requires different ways of doing things. David is
>> suggesting doing EVERYTHING via a single exec() API call and that API
>> receives a single string. The string then describes the different modes. I
>> doubt that the single string approach actually works across databases (but
>> may be wrong ;)).
>
> Perhaps I'm confused - by API do you refer to database-specific
> libraries (like libpq) or the rsyslog-internal API between the core &
> database output modules?  If the latter, I've completely misunderstood
> your questions.

I believe that we are talking about the rsyslog to database interface 
here.

I think that there is confusion between the actual database interface and 
the software API

for libpq, there are different ways of doing the same thing, you can make 
a library call specific to the function you want to perform, or you can 
craft a SQL statement and send it via an exec call.

someone sniffing the network between the two machines would not be able to 
tell the difference between the two (unless they know the specific library 
and recognise that it's being done slightly differently)

it's possible for a database to define a binary API in addition to the 
text SQL API, but I'm not aware of it being used for normal software. 
Postgres does not have a binary API like this (it gets talked about every 
once in a while as a way to speed up huge tasks, but the normal prepared 
statements/stored procedures are able to eliminate so much of the overhead 
for normal use that there's never been enough of a need to implement one)

> I was most specifically responding to this statement by you, which
> seemed supported in your later Oracle/PosgreSQL-specific questions:
>> There is a problem with this example - and that is that each database
>> provides its own API for prepared statements.
>
> Although this is true, most databases also have a pure-SQL interface
> for defining and calling [stored procedures|prepared statements] that
> can be used with a simple exec(SQL) call instead of the
> language-specific [C|C++|Java|Lisp] API calls.  The tradeoff is (as
> usual) efficiency versus flexibility.

is it really any more efficiant to define a stored procedure or prepared 
statement through the API than through the exec() call?

and even if it is, is this something that is done once per startup or 
every command? if it's once per startup the complexity cost may not be 
worth the small time savings.

David Lang
_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com

Reply via email to