# Database recreate performance

**URL:** https://forum.duplicati.com/t/database-recreate-performance/5999
**Category:** Developer
**Created:** [January 14, 2019, 9:37pm UTC](https://forum.duplicati.com/t/database-recreate-performance/5999 "2019-01-14T21:37:32Z")
**Posts on this page:** 1
**Showing post:** 34

<div class="post-metadata">

### Author: ![ts678](https://forum.duplicati.com/letter_avatar_proxy/v4/letter/t/8491ac/32.png) [@ts678](https://forum.duplicati.com/u/ts678)
#### Post date: [February 20, 2023, 12:30am UTC](https://forum.duplicati.com/t/database-recreate-performance/5999/34 "2023-02-20T00:30:45Z")

</div>

> [@JimboJones](#):
>
> changing the default `-blocksize` to a larger value (YTBD) is likely a simple change

Maybe here:

> <https://github.com/duplicati/duplicati/blob/666b2281032460254839fdc3b6e1055fdf7ce1db/Duplicati/Library/Main/Options.cs#L38-L41>

> [@JimboJones](#):
>
> I’m thinking 100K just isn’t quite enough for the amounts of data people are now backing up.

I’d agree, although there might still be improvements possible for some areas such as recreate.  
If, for example, it’s doing anything (e.g. SQL) per-block, that will really add up with many blocks.  
@gpatel-fr has likely looked at that more than I have, in addition to being better at C# and SQL.

> [@JimboJones](#):
>
> I think this should be a local process vs processing directly to a remote destination.

That would simplify it, if it winds up being a standalone. A less complex rewriter is described at:

[Re encrypt remote back end files](https://github.com/duplicati/duplicati/wiki/Re-encrypt-remote-back-end-files) (referencing a Python script from forum user @Wim_Jansen)

and it also gets into more of the little details of the files. First thing to do might be to open a few.  
Format doesn’t seem super complicated. A file is either a block or a blocklist that lists its blocks.  
Both cases identify a block by its SHA-256 hash, sometimes directly, sometimes after a Base64.

The challenge is that a hash is one-way, so hash of (say) 10 blocks in sequence can’t be known  
unless the blocks are around. Unfortunately they’re packed into dblock files, but can be undone,  
however that’s more storage space temporarily while repacking data into larger blocks per spec.

Following the idea of opening a few files, unzip of a dblock can just drop all its blocks right there.  
The dindex file has a `vol` folder with a file of JSON data describing the contents of its dblock file.  
There might also be a `list` folder to hold redundant copies of blocklists also in its big dblock file.

EDIT:

[Duplicati.CommandLine.RecoveryTool.exe](https://duplicati.readthedocs.io/en/latest/07-other-command-line-utilities/#duplicaticommandlinerecoverytoolexe) is another rewriter, in C#, working on recompression.  
[Duplicati.CommandLine.BackendTool.exe](https://duplicati.readthedocs.io/en/latest/07-other-command-line-utilities/#duplicaticommandlinebackendtoolexe) might possibly be the basis for a file uploader where it  
matters that the uploaded files wind up looking like Duplicati made them. Google Drive likes that.

---

_[View the full topic](https://forum.duplicati.com/t/database-recreate-performance/5999)._
