Skip to content

Missing index on 'resubmit_job_id' for 'jobs' table #194

@bzizou

Description

@bzizou

On a big OAR DB (70M jobs), the NodeChangeState command may lock OAR for a long time on such queries:

2022-03-22 13:21:01.231 CET [42503] oar@oar LOG:  duration: 413415.226 ms  statement:    SELECT COUNT(*)
                                        FROM jobs
                                        WHERE
                                            resubmit_job_id = 69815420

A new index solves this issue:

CREATE INDEX job_resubmit_job_id ON jobs (resubmit_job_id);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions