apache / apache/airflow

Add index on `hostname` column of `job` table

Open
#62,519 4 comments 0 reactions 0 assignees View on GitHub
area:MetaDB area:performance kind:feature needs-triage
Dominant language
Python
Stars
46.9k
Forks
17.8k
Avg merge
2d 9h
Merged PRs (30d)
472

Description

### Description

Add an index on the `hostname` column of the `job` table.

### Use case/motivation

Currently, running CLI healthchecks for the scheduler or dag processor can take a long time. This is particularly relevant in a setup where hostnames are dynamically generated / rotated frequently, such as in k8s deploys. The addition of the `hostname` index would help improve the performance of those CLI-based healthchecks. There are likely other areas which would benefit from this index addition.

### Related issues

The addition of this feature would narrow the implementation work required for https://github.com/apache/airflow/issues/62518, but these two issues are functionally distinct.

### Are you willing to submit a PR?

- [x] Yes I am willing to submit a PR!

### Code of Conduct

- [x] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.