Subject very slow inserts with blob-fields
Author Bryan Cole

I'm finding that insert performance with firebird is dramatically slower than sqlite to the point where I must be doing something stupid. I'm using superclassic server v2.5 on linux (ext4 fs). The client is running on the same host as the server, using libfbclient (via the python fdb bindings). My test table looks like:

  ID integer NOT NULL,
  NAME varchar(50),
  RANK integer,
  "value" float,
  "timestamp" timestamp,
  WAVEFORM blob sub_type 0,

The problem is the blob field. Inserting records without a WAVEFORM value goes at an acceptable 1000 inserts / sec. However, when I use a 32KB string for the blob value, the insert rate drops to < 10/sec.

The read-speed for the 32KB blobs is OK at >2000 rows/sec, so the network overhead is clearly not a factor. sqlite can write the same table structure and volume of data at the 1000s rows/sec so the underlying disk bandwidth is also not the limitation. This is the only table in my database. The fdb bindings use prepared statements with parameters.

I'm using firebird in its default configuration out-the-box on fedora-20. The database page size is 4096.

Surely I'm missing something important?