Skip to content

Commit 8a5de7c

Browse files
authored
cache: more efficient sqlite indices (#4142)
1 parent 981636f commit 8a5de7c

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lib/cache/sqlite-cache-store.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,8 @@ module.exports = class SqliteCacheStore {
134134
staleAt INTEGER NOT NULL
135135
);
136136
137-
CREATE INDEX IF NOT EXISTS idx_cacheInterceptorV${VERSION}_url ON cacheInterceptorV${VERSION}(url);
138-
CREATE INDEX IF NOT EXISTS idx_cacheInterceptorV${VERSION}_method ON cacheInterceptorV${VERSION}(method);
139-
CREATE INDEX IF NOT EXISTS idx_cacheInterceptorV${VERSION}_deleteAt ON cacheInterceptorV${VERSION}(deleteAt);
137+
CREATE INDEX IF NOT EXISTS idx_cacheInterceptorV${VERSION}_getValuesQuery ON cacheInterceptorV${VERSION}(url, method, deleteAt);
138+
CREATE INDEX IF NOT EXISTS idx_cacheInterceptorV${VERSION}_deleteByUrlQuery ON cacheInterceptorV${VERSION}(deleteAt);
140139
`)
141140

142141
this.#getValuesQuery = this.#db.prepare(`

0 commit comments

Comments
 (0)