diff --git a/src/LevelDBStore/IO/Data/LevelDB/Native.cs b/src/LevelDBStore/IO/Data/LevelDB/Native.cs index f9991ff81..8959ae390 100644 --- a/src/LevelDBStore/IO/Data/LevelDB/Native.cs +++ b/src/LevelDBStore/IO/Data/LevelDB/Native.cs @@ -155,6 +155,9 @@ public static class Native [DllImport("libleveldb", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)] public static extern void leveldb_options_set_filter_policy(IntPtr /*Options*/ options, IntPtr /*FilterPolicy*/ policy); + + [DllImport("libleveldb", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr leveldb_filterpolicy_create_bloom(int bits_per_key); #endregion #region ReadOptions diff --git a/src/LevelDBStore/LevelDBStore/config.json b/src/LevelDBStore/LevelDBStore/config.json index e6683b8e4..f31d07fd6 100644 --- a/src/LevelDBStore/LevelDBStore/config.json +++ b/src/LevelDBStore/LevelDBStore/config.json @@ -1,4 +1,4 @@ -{ +{ "PluginConfiguration": { "Path": "Data_LevelDB_{0}" } diff --git a/src/LevelDBStore/Plugins/Storage/Store.cs b/src/LevelDBStore/Plugins/Storage/Store.cs index 5a6503e3d..6d9aba937 100644 --- a/src/LevelDBStore/Plugins/Storage/Store.cs +++ b/src/LevelDBStore/Plugins/Storage/Store.cs @@ -16,7 +16,7 @@ internal class Store : IStore public Store(string path) { - this.db = DB.Open(path, new Options { CreateIfMissing = true }); + this.db = DB.Open(path, new Options { CreateIfMissing = true, FilterPolicy = Native.leveldb_filterpolicy_create_bloom(15) }); byte[] value = db.Get(ReadOptions.Default, LHelper.CreateKey(SYS_Version)); if (value != null && Version.TryParse(Encoding.ASCII.GetString(value), out Version version) && version >= Version.Parse("3.0.0")) return;