mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-12 22:47:12 +03:00
Added indexes and mmap to the private db
This commit is contained in:
@@ -13,4 +13,6 @@ CREATE TABLE IF NOT EXISTS "sponsorTimes" (
|
|||||||
"hashedIP" TEXT NOT NULL,
|
"hashedIP" TEXT NOT NULL,
|
||||||
"timeSubmitted" INTEGER NOT NULL
|
"timeSubmitted" INTEGER NOT NULL
|
||||||
);
|
);
|
||||||
|
CREATE INDEX IF NOT EXISTS sponsorTimes_hashedIP on sponsorTimes(hashedIP);
|
||||||
|
CREATE INDEX IF NOT EXISTS votes_userID on votes(UUID);
|
||||||
COMMIT;
|
COMMIT;
|
||||||
|
|||||||
@@ -17,4 +17,6 @@ CREATE TABLE IF NOT EXISTS "userNames" (
|
|||||||
"userID" TEXT NOT NULL,
|
"userID" TEXT NOT NULL,
|
||||||
"userName" TEXT NOT NULL
|
"userName" TEXT NOT NULL
|
||||||
);
|
);
|
||||||
COMMIT;
|
CREATE INDEX IF NOT EXISTS sponsorTimes_videoID on sponsorTimes(videoID);
|
||||||
|
CREATE INDEX IF NOT EXISTS sponsorTimes_UUID on sponsorTimes(UUID);
|
||||||
|
COMMIT;
|
||||||
1
index.js
1
index.js
@@ -51,6 +51,7 @@ if (!config.readOnly && config.mode === "production") {
|
|||||||
|
|
||||||
// Enable Memory-Mapped IO
|
// Enable Memory-Mapped IO
|
||||||
db.exec("pragma mmap_size= 500000000;");
|
db.exec("pragma mmap_size= 500000000;");
|
||||||
|
privateDB.exec("pragma mmap_size= 500000000;");
|
||||||
|
|
||||||
//setup CORS correctly
|
//setup CORS correctly
|
||||||
app.use(function(req, res, next) {
|
app.use(function(req, res, next) {
|
||||||
|
|||||||
Reference in New Issue
Block a user