# How long should a repair of a database take?

**URL:** <https://forum.duplicati.com/t/how-long-should-a-repair-of-a-database-take/1357>\
**Category:** Uncategorized\
**Created:** [November 10, 2017, 11:57pm UTC](https://forum.duplicati.com/t/how-long-should-a-repair-of-a-database-take/1357 "2017-11-10T23:57:30Z")\
**Posts on this page:** 1\
**Showing post:** 22

<div class="post-metadata">

**Author:** ![JonMikelV](https://forum.duplicati.com/letter_avatar_proxy/v4/letter/j/439d5e/32.png) [@JonMikelV](https://forum.duplicati.com/u/JonMikelV)\
**Post date:** [March 25, 2018, 6:21am UTC](https://forum.duplicati.com/t/how-long-should-a-repair-of-a-database-take/1357/22 "2018-03-25T06:21:52Z")

</div>

I usually just store something like a row ID to the hash record and an SHA1 of the hash itself (primary key, for sorting proposed, allowing duplicates).

That opens up options like:

- a left join through the SHA1 temp table to the actual hash table
- exists check prompting the expensive current lookup on actual hash
- count \> 1 prompting a less expensive current lookup on row ID (assuming it’s a key or indexed field) and hash

Again this all is based on my assumptions of the issue, I still haven’t dug into the code yet.

Oh, and if you stuck around this far into the post you get to know that my recreate finished after 4 days, 5 hours, 37 minutes. 🙂

---

_[View the full topic](https://forum.duplicati.com/t/how-long-should-a-repair-of-a-database-take/1357)._
