citusdata / citusdata/pg_cron

Index on the `cron.job_run_details` table

Open
#408 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
3.9k
Forks
260
Avg merge
5d 5h
Merged PRs (30d)
1

Description

The `cron.job_run_details` table can get big and queries on it can get noticeably slower.

I propose to add indexes to speed up queries.

1 - An index on `jobid` column (ideally `jobid`, `start_time` to be able to order or filter by time). Without index on `jobid` queries get slow when it is necessary to analyze or check status or logs for specific job.
2 - An index on `end_time` column. Without such index [the recommended clean up query](https://github.com/citusdata/pg_cron?tab=readme-ov-file#viewing-job-run-details) gets slow.

What do you think? Did you consider adding indexes to `cron.job_run_details`?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.