@@ -183,6 +183,13 @@ impl Store {
183183 db_options. set_compression_type ( rocksdb:: DBCompressionType :: None ) ;
184184 db_options. set_bottommost_compression_type ( rocksdb:: DBCompressionType :: None ) ;
185185
186+ let mut block_opts = BlockBasedOptions :: default ( ) ;
187+ block_opts. set_block_size ( 16 * 1024 ) ; // 16KB
188+ block_opts. set_bloom_filter ( 10.0 , false ) ; // 10 bits per key
189+ block_opts. set_index_type ( rocksdb:: BlockBasedIndexType :: HashSearch ) ;
190+ block_opts. set_data_block_index_type ( rocksdb:: DataBlockIndexType :: BinaryAndHash ) ;
191+ db_options. set_block_based_table_factory ( & block_opts) ;
192+
186193 // db_options.enable_statistics();
187194 // db_options.set_stats_dump_period_sec(600);
188195
@@ -243,6 +250,19 @@ impl Store {
243250 cf_opts. set_level_zero_stop_writes_trigger ( 36 ) ;
244251 cf_opts. set_compression_type ( rocksdb:: DBCompressionType :: None ) ;
245252
253+ cf_opts. set_prefix_extractor ( if cf_name != CF_FLATKEYVALUE {
254+ SliceTransform :: create_noop ( )
255+ } else {
256+ SliceTransform :: create_fixed_prefix ( 65 )
257+ } ) ;
258+
259+ let mut block_opts = BlockBasedOptions :: default ( ) ;
260+ block_opts. set_block_size ( 16 * 1024 ) ; // 16KB
261+ block_opts. set_bloom_filter ( 10.0 , false ) ; // 10 bits per key
262+ block_opts. set_index_type ( rocksdb:: BlockBasedIndexType :: HashSearch ) ;
263+ block_opts. set_data_block_index_type ( rocksdb:: DataBlockIndexType :: BinaryAndHash ) ;
264+ cf_opts. set_block_based_table_factory ( & block_opts) ;
265+
246266 match cf_name. as_str ( ) {
247267 CF_HEADERS | CF_BODIES => {
248268 cf_opts. set_write_buffer_size ( 128 * 1024 * 1024 ) ; // 128MB
@@ -251,7 +271,7 @@ impl Store {
251271
252272 let mut block_opts = BlockBasedOptions :: default ( ) ;
253273 block_opts. set_block_size ( 32 * 1024 ) ; // 32KB blocks
254- cf_opts. set_block_based_table_factory ( & block_opts) ;
274+ // cf_opts.set_block_based_table_factory(&block_opts);
255275 }
256276 CF_CANONICAL_BLOCK_HASHES | CF_BLOCK_NUMBERS => {
257277 cf_opts. set_write_buffer_size ( 64 * 1024 * 1024 ) ; // 64MB
@@ -261,7 +281,7 @@ impl Store {
261281 let mut block_opts = BlockBasedOptions :: default ( ) ;
262282 block_opts. set_block_size ( 16 * 1024 ) ; // 16KB
263283 block_opts. set_bloom_filter ( 10.0 , false ) ;
264- cf_opts. set_block_based_table_factory ( & block_opts) ;
284+ // cf_opts.set_block_based_table_factory(&block_opts);
265285 }
266286 CF_TRIE_NODES => {
267287 cf_opts. set_write_buffer_size ( 512 * 1024 * 1024 ) ; // 512MB
@@ -273,22 +293,14 @@ impl Store {
273293 let mut block_opts = BlockBasedOptions :: default ( ) ;
274294 block_opts. set_block_size ( 16 * 1024 ) ; // 16KB
275295 block_opts. set_bloom_filter ( 10.0 , false ) ; // 10 bits per key
276- cf_opts. set_block_based_table_factory ( & block_opts) ;
296+ // cf_opts.set_block_based_table_factory(&block_opts);
277297 }
278298 CF_FLATKEYVALUE => {
279299 cf_opts. set_write_buffer_size ( 512 * 1024 * 1024 ) ; // 512MB
280300 cf_opts. set_max_write_buffer_number ( 6 ) ;
281301 cf_opts. set_min_write_buffer_number_to_merge ( 2 ) ;
282302 cf_opts. set_target_file_size_base ( 256 * 1024 * 1024 ) ; // 256MB
283303 cf_opts. set_memtable_prefix_bloom_ratio ( 0.2 ) ; // Bloom filter
284-
285- cf_opts. set_prefix_extractor ( SliceTransform :: create_fixed_prefix ( 65 ) ) ;
286- let mut block_opts = BlockBasedOptions :: default ( ) ;
287- block_opts. set_block_size ( 16 * 1024 ) ; // 16KB
288- block_opts. set_bloom_filter ( 10.0 , false ) ; // 10 bits per key
289- block_opts. set_index_type ( rocksdb:: BlockBasedIndexType :: HashSearch ) ;
290- block_opts. set_data_block_index_type ( rocksdb:: DataBlockIndexType :: BinaryAndHash ) ;
291- cf_opts. set_block_based_table_factory ( & block_opts) ;
292304 }
293305 CF_RECEIPTS | CF_ACCOUNT_CODES => {
294306 cf_opts. set_write_buffer_size ( 128 * 1024 * 1024 ) ; // 128MB
@@ -297,7 +309,7 @@ impl Store {
297309
298310 let mut block_opts = BlockBasedOptions :: default ( ) ;
299311 block_opts. set_block_size ( 32 * 1024 ) ; // 32KB
300- cf_opts. set_block_based_table_factory ( & block_opts) ;
312+ // cf_opts.set_block_based_table_factory(&block_opts);
301313 }
302314 _ => {
303315 // Default for other CFs
@@ -307,7 +319,7 @@ impl Store {
307319
308320 let mut block_opts = BlockBasedOptions :: default ( ) ;
309321 block_opts. set_block_size ( 16 * 1024 ) ;
310- cf_opts. set_block_based_table_factory ( & block_opts) ;
322+ // cf_opts.set_block_based_table_factory(&block_opts);
311323 }
312324 }
313325
0 commit comments