@@ -180,6 +180,8 @@ impl Store {
180180 db_options. set_enable_write_thread_adaptive_yield ( true ) ;
181181 db_options. set_compaction_readahead_size ( 4 * 1024 * 1024 ) ; // 4MB
182182 db_options. set_advise_random_on_open ( false ) ;
183+ db_options. set_compression_type ( rocksdb:: DBCompressionType :: None ) ;
184+ db_options. set_bottommost_compression_type ( rocksdb:: DBCompressionType :: None ) ;
183185
184186 // db_options.enable_statistics();
185187 // db_options.set_stats_dump_period_sec(600);
@@ -239,10 +241,10 @@ impl Store {
239241 cf_opts. set_level_zero_file_num_compaction_trigger ( 4 ) ;
240242 cf_opts. set_level_zero_slowdown_writes_trigger ( 20 ) ;
241243 cf_opts. set_level_zero_stop_writes_trigger ( 36 ) ;
244+ cf_opts. set_compression_type ( rocksdb:: DBCompressionType :: None ) ;
242245
243246 match cf_name. as_str ( ) {
244247 CF_HEADERS | CF_BODIES => {
245- cf_opts. set_compression_type ( rocksdb:: DBCompressionType :: Zstd ) ;
246248 cf_opts. set_write_buffer_size ( 128 * 1024 * 1024 ) ; // 128MB
247249 cf_opts. set_max_write_buffer_number ( 4 ) ;
248250 cf_opts. set_target_file_size_base ( 256 * 1024 * 1024 ) ; // 256MB
@@ -252,7 +254,6 @@ impl Store {
252254 cf_opts. set_block_based_table_factory ( & block_opts) ;
253255 }
254256 CF_CANONICAL_BLOCK_HASHES | CF_BLOCK_NUMBERS => {
255- cf_opts. set_compression_type ( rocksdb:: DBCompressionType :: Lz4 ) ;
256257 cf_opts. set_write_buffer_size ( 64 * 1024 * 1024 ) ; // 64MB
257258 cf_opts. set_max_write_buffer_number ( 3 ) ;
258259 cf_opts. set_target_file_size_base ( 128 * 1024 * 1024 ) ; // 128MB
@@ -263,7 +264,18 @@ impl Store {
263264 cf_opts. set_block_based_table_factory ( & block_opts) ;
264265 }
265266 CF_TRIE_NODES => {
266- cf_opts. set_compression_type ( rocksdb:: DBCompressionType :: Lz4 ) ;
267+ cf_opts. set_write_buffer_size ( 512 * 1024 * 1024 ) ; // 512MB
268+ cf_opts. set_max_write_buffer_number ( 6 ) ;
269+ cf_opts. set_min_write_buffer_number_to_merge ( 2 ) ;
270+ cf_opts. set_target_file_size_base ( 256 * 1024 * 1024 ) ; // 256MB
271+ cf_opts. set_memtable_prefix_bloom_ratio ( 0.2 ) ; // Bloom filter
272+
273+ let mut block_opts = BlockBasedOptions :: default ( ) ;
274+ block_opts. set_block_size ( 16 * 1024 ) ; // 16KB
275+ block_opts. set_bloom_filter ( 10.0 , false ) ; // 10 bits per key
276+ cf_opts. set_block_based_table_factory ( & block_opts) ;
277+ }
278+ CF_FLATKEYVALUE => {
267279 cf_opts. set_write_buffer_size ( 512 * 1024 * 1024 ) ; // 512MB
268280 cf_opts. set_max_write_buffer_number ( 6 ) ;
269281 cf_opts. set_min_write_buffer_number_to_merge ( 2 ) ;
@@ -276,7 +288,6 @@ impl Store {
276288 cf_opts. set_block_based_table_factory ( & block_opts) ;
277289 }
278290 CF_RECEIPTS | CF_ACCOUNT_CODES => {
279- cf_opts. set_compression_type ( rocksdb:: DBCompressionType :: Lz4 ) ;
280291 cf_opts. set_write_buffer_size ( 128 * 1024 * 1024 ) ; // 128MB
281292 cf_opts. set_max_write_buffer_number ( 3 ) ;
282293 cf_opts. set_target_file_size_base ( 256 * 1024 * 1024 ) ; // 256MB
@@ -287,7 +298,6 @@ impl Store {
287298 }
288299 _ => {
289300 // Default for other CFs
290- cf_opts. set_compression_type ( rocksdb:: DBCompressionType :: Lz4 ) ;
291301 cf_opts. set_write_buffer_size ( 64 * 1024 * 1024 ) ; // 64MB
292302 cf_opts. set_max_write_buffer_number ( 3 ) ;
293303 cf_opts. set_target_file_size_base ( 128 * 1024 * 1024 ) ; // 128MB
0 commit comments