On Wed, Apr 1, 2009 at 10:02, Luis Fernando Muñoz Mejías
<[email protected]> wrote:
> Hello, world.
Oi. :) Sorry I'm late to the game.
> It works, but it's way too slow for my needs. As I said when I started
> this project, I need to be very fast, to prepare the statement at
> connection time, run it many times, and definitely want batch
> operations. Say, I want to insert 1000 entries with a single call to the
> Oracle interface, then commit.
Forgive me - my database-performance-fu and oracle-fu are not terribly
strong, I may make a fool of myself here. What is the performance
gain of making a prepared statement over just executing raw
statements? IOW, why choose (please forgive my SQL):
CREATE PROCEDURE zazz AS
insert into foo(field1, field2, field3) values(:val1, :val2, :val3);
SET TRANSACTION;
zazz("foo", "bar", "baz");
zazz("foo1", "bar1", "baz1");
zazz("foo2", "bar2", "baz2");
COMMIT;
-- over
SET TRANSACTION;
INSERT INTO foo(field1, field2, field3) values("foo", "bar", "baz");
INSERT INTO foo(field1, field2, field3) values("foo1", "bar1", "baz1");
INSERT INTO foo(field1, field2, field3) values("foo2", "bar2", "baz2");
COMMIT;
Perhaps that's not even what you're doing. I know there are other
considerations and niceties with procedures, but the latter syntax
would still allow for batched transactions while enabling rsyslog to
do the dirty work of formatting the query and not necessitating
exposure of internal structures.
I confess to being a bit confused as to why the existing output module
interface wasn't readily extending to batching, since I've tended to
see the output modules as more of thin, final-hop proxies. IMHO,
database output modules should still pretty much blindly execute
whatever SQL rsyslog hands them, be that wrapped in a transaction or
not.
That said (and more a question for Rainer), do rsyslog templates have
support for a null character? If so, it may be a more viable approach
for delimiting simple fields than changing the output module API. Of
course the CSV approach works too, but seems easier to break out of
than null-delimiting.
_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com