The [PK] field is the primary key, 1---n is a 'one to any' relationship.
All primary keys are unique in this data model.
      .-----------.
      | state     |
      |-----------|
      | key  [PK] |
      | value     |
      `-----------'
 
      .-----------.       .-------------.
      | collect   |       | counter     |       .----------.
      |-----------|       |-------------|       | logfile  |
  .--1| run  [PK] |1-----n| collect_run |       |----------|
  |   | begin     |       | logfile_id  |n-----1| id  [PK] |1--.
  |   | end       |       | level       |       | filename |   |
  |   `-----------'       | count       |       `----------'   |
  |                       `-------------'                      |
  |                                                            |
  |                       .-------------.                      |
  |                       | match       |                      |
  |                       |-------------|                      |
  `----------------------n| collect_run |                      |
                          | logfile_id  |n---------------------'
                          | timestamp   |
                          | level       |
                          | message     |
                          `-------------'
Collect run entries are never deleted.
The data collection can be disabled using the COLLECT=False setting in the daemon configuration file or using the -a nocollect option on the command line.
Data collection is automatically suspended when the available storage on the filesystem where the state.db resides gets tight. A suspended collection is automatically resumed after sufficient storage is available, again.
If data collection is disabled or suspended the matches are still counted and saved to the counter table.
This is free software; see edrc/doc/COPYING for copying conditions. There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.