Patch to lock mysql table for write before inserting flow data. Unlocks after import.
Greatly improves import performance and reduces server load.

Get the actual patch here
Get FC4 RPMS of 0.68b+patches here

by Void Main (warning: extreme hack)

---------------- Cut Here ----------------
--- flow-tools-0.68/src/flow-export.c.orig      2005-12-12 11:10:24.000000000 -0600
+++ flow-tools-0.68/src/flow-export.c   2005-12-12 15:55:18.000000000 -0600
@@ -749,6 +749,13 @@
        db_name, db_port, NULL, 0) == NULL)
     fterr_errx(1,"mysql_real_connect(): %s\n", mysql_error(&mysql));

+  /* LOCK Table for faster INSERTs */
+  strcpy (query, "LOCK TABLES ");
+  strcat (query, db_table);
+  strcat (query, " WRITE");
+  if (mysql_real_query(&mysql, query, strlen(query)) != 0) 
+    fterr_warnx("mysql_real_query(): %s", mysql_error(&mysql));
+
   /* foreach flow */
   while ((rec = ftio_read(ftio))) {

@@ -758,7 +765,7 @@
     if (len) {
       strcpy (query, "INSERT INTO ");
       strcat (query, db_table);
-      strcat (query, "(");
+      strcat (query, " (");
       strcat (query, fields);
       strcat (query, ") VALUES (");
       strcat (query, values);
@@ -777,6 +784,11 @@

   } /* while */

+  /* LOCK Table for faster INSERTs */
+  strcpy (query, "UNLOCK TABLES");
+  if (mysql_real_query(&mysql, query, strlen(query)) != 0) 
+    fterr_warnx("mysql_real_query(): %s", mysql_error(&mysql));
+
   /* close database */
   mysql_close(&mysql);

@@ -1465,7 +1477,7 @@

 void usage(void) {

-  fprintf(stderr, "Usage: flow-export [-l (long ips)] [-h] [-d debug_level] [-f format] [-m mask_fields] -u [database URI]\n");
+  fprintf(stderr, "Usage: flow-export [-h] [-d debug_level] [-f format] [-l (long ips)] [-m mask_fields] -u [database URI]\n");
   fprintf(stderr, "\n%s version %s: built by %s\n", PACKAGE, VERSION, FT_PROG_BUILD);