Database behavior

Greetings again.

I had a few questions regarding the expected behavior once the database is full. Specifically:

  1. Once the database is full, how is new device data handled? Are the oldest records deleted as new ones are added? Are new data records dropped?
  2. If devices are deleted, are their records deleted from the database? If not, how would one manually delete these stale records?

Thanks for the tips!
-AD

There is no automatic DB management.
If a DB is over limit, INSERT will fail.
If you delete a device, its records remain.
DB is under your full control and it is your responsibility to vaccum, delete old records, etc.

lsm,

Thanks for these details - looks like I would have found out the hard way is a short period of time.

Would be great if mDash could implement a threshold alert whereby the owner was notified when the database size was approaching its limit. Far better than having that same owner getting angry calls from his customers when that limit was reached.

-AD

That’s a good idea!
We’ll do that.

On a related note:

When the mDash dashboard reports the database used, e.g.:

DB size: 1085440
Max size: 5120000

…are these numbers referring to db records or file size?

Thanks!
-AD

The file size.

The limitation is set on file size, the internal structure of the database is up to a user.

Continuing on the db size topic…

I’ve noticed that when executing DELETE SQL command to remove records from the db, the ‘DB Size’ reported by mDash does not change. Is there an expected lag between record removal and an accurate reporting on the ‘Data’ tab?

Thanks,
-AD

There is no lag, it is immediate.
Maybe you need to execute sqlite’s vacuum to collect the garbage.

1 Like

That was it! Thanks for the pro tip.

-AD