Sqlite pragma settings

Unfortunately I did accidently choose sqlite for our database. Now I try to tune it, that it is not that slow.

There are pragma settings, which need to be appied in the running session. For example:

pragma journal_mode = WAL;
pragma synchronous = normal;
pragma journal_size_limit = 6144000;
pragma mmap_size = 1000000000;

Is there a way, e.g. with environment variables, to pass these through to the database?

@Mado : welcome to NocoDB

Currently, there are no environment variable to alter SQLIte database when you self-host on SQLite.

Can you tell us more on what was not slow :grinning_face_with_smiling_eyes:

Explain with numbers please.

In our association we build complex cost plans for projects with local councils. Applied are number of schools, number of classes, number of pupils, number of days for workshops and everything is calculated with many formulars with IF…ELSE clauses and so on.

42 cost plan positions from a template had to be duplicated for 12 cost plans, so:

  • copy one data record
  • save the copy

One such process did last 1:30 til 1:45 minutes. We were working with 6 people concurrently, what I know is bad for sqlite.

The table with cost plan positions started with about 120 records, now 7-8 times as much.

The vps has 4 cpu cores an 4 GB RAM. Of about 1 GB ist used all in all, some smaller apps are also running on this server, reverse proxy etc…

Nocodb is the newest docker version. We make use of lookups, formulars, rollups. Many values in the cast plan positions are calculated according to other values from lookups.

BTW, it happened sometimes (2-4x), that after the copy had been committed, a completely different data record was shown afterwards, although the real commit was ok. Just, as if something gets confused, if many people do this same process. This is a (not that important) bug somewhere.