Tip for improving sqlite performance

Hi,
Just a suggestion for improving the sqlite performance based on what I’ve done on my installation:
modify ./libs/picodb/lib/PicoDb/Driver/Sqlite.php

add “$this->pdo->exec(‘pragma synchronous = off;’);”

after the " $this->pdo = new PDO(‘sqlite:’.$settings[‘filename’], null, null, $options);"

It dramactically improves the responsiveness when sqlite gets above 3000 tasks.

That being said, make sure you are running on a stable system and backup regularly since sudden OS crashes or power outages can result in corruption - Pragma statements supported by SQLite

1 Like

I’ve tried your solution with the current version, but this wont work anymore?

PHP message: PHP Parse error: syntax error, unexpected 'synchronous' (T_STRING), expecting ')' in /var/www/app/libs/picodb/lib/PicoDb/Driver/Sqlite.php on line 39",

I’ve added it as following within the config file;

        $this->pdo = new PDO('sqlite:'.$settings['filename'], null, null, $options);
        $this->pdo->exec(‘pragma synchronous = off;’);
        $this->enableForeignKeys();