Skip to content

Add some indexes for the queries that don't use primary keys to select #731

@f-f

Description

@f-f

we should add some indexes for the queries that don't use primary keys to select:

-- For duplicate detection in publish jobs
CREATE INDEX IF NOT EXISTS idx_publish_jobs_name_version
ON publish_jobs (packageName, packageVersion);

-- For duplicate detection in unpublish jobs
CREATE INDEX IF NOT EXISTS idx_unpublish_jobs_name_version
ON unpublish_jobs (packageName, packageVersion);

-- For duplicate detection in transfer jobs
CREATE INDEX IF NOT EXISTS idx_transfer_jobs_name
ON transfer_jobs (packageName);

-- For job selection performance
CREATE INDEX IF NOT EXISTS idx_job_info_pending
ON job_info (createdAt)
WHERE finishedAt IS NULL AND startedAt IS NULL;

Originally posted by @f-f in #669 (comment)

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