Skip to content

Commit 96e1d58

Browse files
sallyxdg
authored andcommitted
SQLiteJournal: optimizations [Closes #34]
disabled foreign keys check removed unnecessary indices enabled journal_mode WAL
1 parent 4f93c5f commit 96e1d58

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Caching/Storages/SQLiteJournal.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ public function __construct($path)
3232
$this->pdo = new \PDO('sqlite:' . $path);
3333
$this->pdo->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION);
3434
$this->pdo->exec('
35-
PRAGMA foreign_keys = ON;
35+
PRAGMA foreign_keys = OFF;
36+
PRAGMA journal_mode = WAL;
3637
CREATE TABLE IF NOT EXISTS tags (
3738
key BLOB NOT NULL,
3839
tag BLOB NOT NULL
@@ -41,7 +42,6 @@ public function __construct($path)
4142
key BLOB NOT NULL,
4243
priority INT NOT NULL
4344
);
44-
CREATE INDEX IF NOT EXISTS idx_tags_key ON tags(key);
4545
CREATE INDEX IF NOT EXISTS idx_tags_tag ON tags(tag);
4646
CREATE UNIQUE INDEX IF NOT EXISTS idx_tags_key_tag ON tags(key, tag);
4747
CREATE UNIQUE INDEX IF NOT EXISTS idx_priorities_key ON priorities(key);

0 commit comments

Comments
 (0)