mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-05-31 20:24:21 -04:00
Fine tune DB settings
This commit is contained in:
parent
56ef45ebf0
commit
ab918c6292
@ -60,11 +60,16 @@ namespace Emby.Server.Implementations.Data
|
|||||||
/// <value>The cache size or null.</value>
|
/// <value>The cache size or null.</value>
|
||||||
protected virtual int? CacheSize => null;
|
protected virtual int? CacheSize => null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the locking mode. <see href="https://www.sqlite.org/pragma.html#pragma_locking_mode" />.
|
||||||
|
/// </summary>
|
||||||
|
protected virtual string LockingMode => "EXCLUSIVE";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the journal mode. <see href="https://www.sqlite.org/pragma.html#pragma_journal_mode" />.
|
/// Gets the journal mode. <see href="https://www.sqlite.org/pragma.html#pragma_journal_mode" />.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The journal mode.</value>
|
/// <value>The journal mode.</value>
|
||||||
protected virtual string JournalMode => "TRUNCATE";
|
protected virtual string JournalMode => "WAL";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the page size.
|
/// Gets the page size.
|
||||||
@ -116,6 +121,11 @@ namespace Emby.Server.Implementations.Data
|
|||||||
WriteConnection.Execute("PRAGMA cache_size=" + CacheSize.Value);
|
WriteConnection.Execute("PRAGMA cache_size=" + CacheSize.Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!string.IsNullOrWhiteSpace(LockingMode))
|
||||||
|
{
|
||||||
|
WriteConnection.Execute("PRAGMA locking_mode=" + LockingMode);
|
||||||
|
}
|
||||||
|
|
||||||
if (!string.IsNullOrWhiteSpace(JournalMode))
|
if (!string.IsNullOrWhiteSpace(JournalMode))
|
||||||
{
|
{
|
||||||
WriteConnection.Execute("PRAGMA journal_mode=" + JournalMode);
|
WriteConnection.Execute("PRAGMA journal_mode=" + JournalMode);
|
||||||
|
@ -359,8 +359,6 @@ namespace Emby.Server.Implementations.Data
|
|||||||
|
|
||||||
string[] queries =
|
string[] queries =
|
||||||
{
|
{
|
||||||
"PRAGMA locking_mode=EXCLUSIVE",
|
|
||||||
|
|
||||||
"create table if not exists TypedBaseItems (guid GUID primary key NOT NULL, type TEXT NOT NULL, data BLOB NULL, ParentId GUID NULL, Path TEXT NULL)",
|
"create table if not exists TypedBaseItems (guid GUID primary key NOT NULL, type TEXT NOT NULL, data BLOB NULL, ParentId GUID NULL, Path TEXT NULL)",
|
||||||
|
|
||||||
"create table if not exists AncestorIds (ItemId GUID NOT NULL, AncestorId GUID NOT NULL, AncestorIdText TEXT NOT NULL, PRIMARY KEY (ItemId, AncestorId))",
|
"create table if not exists AncestorIds (ItemId GUID NOT NULL, AncestorId GUID NOT NULL, AncestorIdText TEXT NOT NULL, PRIMARY KEY (ItemId, AncestorId))",
|
||||||
|
@ -273,10 +273,6 @@ namespace Jellyfin.Server
|
|||||||
ServicePointManager.Expect100Continue = false;
|
ServicePointManager.Expect100Continue = false;
|
||||||
|
|
||||||
Batteries_V2.Init();
|
Batteries_V2.Init();
|
||||||
if (raw.sqlite3_enable_shared_cache(1) != raw.SQLITE_OK)
|
|
||||||
{
|
|
||||||
_logger.LogWarning("Failed to enable shared cache for SQLite");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user