Parallelized truncates
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
Research direction
Start with lib/database_cleaner/active_record/truncation.rb around line 106 and trace how truncation is shared across adapters. Check the adapter behavior and existing cleanup flow before deciding whether opt-in threaded truncation is safe. Done would require a settled cross-adapter design and a clear decision about the proposed setting and PR scope.
Written by the indexing model from the issue text.
Description
Hello,
I am working in an application that has a pretty large data model that is initially cleaned up with as of today 141 tables being truncated. Each TRUNCATE taking between 10ms and 20ms. That's almost 3 seconds of waiting for my database to be empty.
- Before I start any work, are there any concerns against parallelizing those truncate statements using threads for example?
- Would you be interested by a PR?
Ideas:
- opt-in setting, parallelization would be turned off by default
- I am most familiar with MySQL, but I don't see how running parallel truncates on different tables would be a concern
- The threading would be positioned here, common for all adapters
Thanks,
- Dominant language
- Ruby
- Stars
- 76
- Forks
- 76
- PR merge metrics
- No merged PRs in 30d
Getting set up
We have not checked this project's setup files yet. Start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from DatabaseCleaner/database_cleaner-active_record
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
DatabaseCleaner/database_cleaner-active_record#128 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
DatabaseCleaner/database_cleaner-active_record#127 · 3 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
-
Difficulty 4/5 3-5 days Newbie friendliness 30/100
DatabaseCleaner/database_cleaner-active_record#110 · 1 comment ·
All issues in DatabaseCleaner/database_cleaner-active_record
Similar issues
-
area/web interface
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
chef/mixlib-shellout#287 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day