Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Parallelized truncates

Open
#116 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
mysql, rails, ruby
Domain
databases, testing

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from DatabaseCleaner/database_cleaner-active_record

All issues in DatabaseCleaner/database_cleaner-active_record

Similar issues

More Ruby issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.