Skip to content

chore(jobsdb): multi-consumer compaction improvements - #7248

Merged
atzoum merged 1 commit into
masterfrom
chore.jobsdbmcImpr
Aug 12, 2026
Merged

atzoum merged 1 commit into
masterfrom
chore.jobsdbmcImpr

Conversation

@atzoum

@atzoum atzoum commented Aug 6, 2026 •

Copy link
Copy Markdown
Contributor

Description

Performance optimizations around the compaction probe (checkIfCompactDS):

  • Disabling nested loops in order to force a hash/merge join during the compaction probing query. The planner always estimates the terminal-job subquery at 200 rows, no matter the actual count, so it ends up probing the jobs table once per job.
  • Adding a (job_id) INCLUDE (consumers) index on multi-consumer jobs tables. The join only needs array_length(consumers, 1), so with consumers in the index that side stays index-only and skips the heap.
  • Lowering autovacuum_vacuum_insert_scale_factor to 0.02 on new jobs and job status tables. They're append-only, so only insert-driven autovacuum ever runs on them, and the 0.2 default lets them grow 20% between vacuums — leaving the visibility map that stale and costing every index-only scan a heap fetch for those rows.

Measured on a couple of live datasets, the probe went from ~4.1 to ~2.4 µs per job.

Existing datasets keep the old plan until compaction creates new ones — the index and the autovacuum setting only apply to newly created tables.

Linear Ticket

Resolves PIPE-3240

Security

  • The code changed/added as part of this pull request won't create any security issues with how the software is being used.

@atzoum
atzoum requested review from ktgowtham and mihir20 August 6, 2026 11:52
@atzoum
atzoum force-pushed the chore.jobsdbmcImpr branch from d981da9 to 83857a7 Compare August 6, 2026 12:02
@codecov

codecov Bot commented Aug 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 63.63636% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.89%. Comparing base (9e62d0c) to head (83857a7).

Files with missing lines Patch % Lines
jobsdb/jobsdb_compaction.go 71.42% 1 Missing and 1 partial ⚠️
jobsdb/jobsdb_dataset_ddl.go 50.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7248      +/-   ##
==========================================
- Coverage   80.27%   79.89%   -0.38%     
==========================================
  Files         600      600              
  Lines       67034    67042       +8     
==========================================
- Hits        53811    53563     -248     
- Misses      10070    10334     +264     
+ Partials     3153     3145       -8     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mihir20 mihir20 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@atzoum
atzoum merged commit b4af86c into master Aug 12, 2026
229 of 237 checks passed
@atzoum
atzoum deleted the chore.jobsdbmcImpr branch August 12, 2026 07:25
mihir20 pushed a commit that referenced this pull request Aug 17, 2026
🤖 I have created a release *beep* *boop*
---


##
[1.83.0-rc.1](v1.82.0...v1.83.0-rc.1)
(2026-08-17)


### Features

* add OriginalID and OriginalDestinationID to support replay event
transformations
([#7274](#7274))
([28d38e9](28d38e9))
* bingads integration tests
([#7253](#7253))
([fdb8c0a](fdb8c0a))
* **processor:** fork event processing for rsources pipelines
([#7235](#7235))
([707ea06](707ea06))


### Bug Fixes

* pyt contract tests data race
([#7247](#7247))
([9e62d0c](9e62d0c))


### Miscellaneous

* bump sqlconnect-go to v1.30.2
([#7251](#7251))
([f5d6175](f5d6175))
* **jobsdb:** multi-consumer compaction improvements
([#7248](#7248))
([b4af86c](b4af86c))
* pyt contract tests for candidate releases
([#7252](#7252))
([149e91a](149e91a))
* pyt contract tests for transformations auth
([#7239](#7239))
([ac4a859](ac4a859))
* **router:** support per-partition noOfWorkers override
([#7270](#7270))
([9d6f7cf](9d6f7cf))
* sync release v1.82.0 to main branch
([#7243](#7243))
([a6e29f2](a6e29f2))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: rudderstack-github-actions[bot] <236995729+rudderstack-github-actions[bot]@users.noreply.github.com>
mihir20 pushed a commit that referenced this pull request Aug 18, 2026
🤖 I have created a release *beep* *boop*
---


##
[1.83.0](v1.82.0...v1.83.0)
(2026-08-17)


### Features

* add OriginalID and OriginalDestinationID to support replay event
transformations
([#7274](#7274))
([28d38e9](28d38e9))
* bingads integration tests
([#7253](#7253))
([fdb8c0a](fdb8c0a))
* **processor:** fork event processing for rsources pipelines
([#7235](#7235))
([707ea06](707ea06))


### Bug Fixes

* pyt contract tests data race
([#7247](#7247))
([9e62d0c](9e62d0c))


### Miscellaneous

* bump sqlconnect-go to v1.30.2
([#7251](#7251))
([f5d6175](f5d6175))
* **jobsdb:** multi-consumer compaction improvements
([#7248](#7248))
([b4af86c](b4af86c))
* pyt contract tests for candidate releases
([#7252](#7252))
([149e91a](149e91a))
* pyt contract tests for transformations auth
([#7239](#7239))
([ac4a859](ac4a859))
* **router:** support per-partition noOfWorkers override
([#7270](#7270))
([9d6f7cf](9d6f7cf))
* sync release v1.82.0 to main branch
([#7243](#7243))
([a6e29f2](a6e29f2))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: rudderstack-github-actions[bot] <236995729+rudderstack-github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants