Further optimize sql insertion

Authored by mforns.


Further optimize sql insertion

This changeset tries to reduce the number of batch insertions
by increasing the size of the event queues.

To avoid that low-traffic schemas have to wait for a long time
until the queue is full, schema queues whose first and last
events are more than 5 minutes apart, are flushed to insertion
as well.

Bug: T98588
Change-Id: I7804f83dfaa6fd824b9641e13240518eb430cde1