Skip to content

jobs: batch job creation #64389

@ajwerner

Description

@ajwerner

Is your feature request related to a problem? Please describe.

Create an API to create a batch of jobs. All existing APIs only allow creating a single job at a time.

Describe the solution you'd like

(*jobs.Registry).CreateJobsWithTxn

Additional context

This is one of the remaining work items to fix #41930.

The relevant context is that today we create or update jobs eagerly during schema change operations in

func (p *planner) createOrUpdateSchemaChangeJob(
and similar.

Rather than creating these jobs eagerly, we should just store the intended job record in the extraTxnState and write it in one go before committing. This will be a major performance optimization for the existing code path and will be easy to adopt in the new schema changer.

Epic: CRDB-8577

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-jobsC-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)C-performancePerf of queries or internals. Solution not expected to change functional behavior.T-sql-foundationsSQL Foundations Team (formerly SQL Schema + SQL Sessions)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions