Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

synchronize_log_template: limit query result on DB rather than client #35366

Merged
merged 1 commit into from Nov 2, 2023

Conversation

Taragolis
Copy link
Contributor

In two queries in this function we take only need the first record, however database might return more than one record.

2023-11-02 13:30:24,586 INFO sqlalchemy.engine.Engine SELECT log_template.filename, log_template.elasticsearch_id 
FROM log_template ORDER BY log_template.id DESC

So for prevent unwanted traffic between DB Backend and Airflow better to limit it on DB side

[2023-11-02T13:30:48.927+0400] {base.py:1863} INFO - SELECT log_template.filename, log_template.elasticsearch_id 
FROM log_template ORDER BY log_template.id DESC 
 LIMIT %(param_1)s
2023-11-02 13:30:48,927 INFO sqlalchemy.engine.Engine [generated in 0.00012s] {'param_1': 1}

^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

@potiuk potiuk merged commit 536c9fb into apache:main Nov 2, 2023
45 checks passed
romsharon98 pushed a commit to romsharon98/airflow that referenced this pull request Nov 10, 2023
@ephraimbuddy ephraimbuddy added the type:improvement Changelog: Improvements label Nov 20, 2023
@ephraimbuddy ephraimbuddy added this to the Airflow 2.8.0 milestone Nov 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:improvement Changelog: Improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants