dominikkedziak opened a new issue, #51156: URL: https://github.com/apache/airflow/issues/51156
### Apache Airflow version 3.0.1 ### If "Other Airflow 2 version" selected, which one? All 2.x ### What happened? While using [airflow db export-archived](https://airflow.apache.org/docs/apache-airflow/stable/howto/usage-cli.html#export-the-purged-records-from-the-archive-tables) command it fetches all the results at once instead of paging them. In case of big instances and archiving a lot of data a lot of memory is needed to use this command, othervise it ends up with OOMErrors Exact line: https://github.com/apache/airflow/blob/3.0.1/airflow-core/src/airflow/utils/db_cleanup.py#L163 ### What you think should happen instead? use server-side cursor for paging if available. ### How to reproduce Create a database that has tables with the size bigger than your memory and then try to archive data with use of airflow db export-archived command. ### Operating System K8s - pods with Ubuntu ### Versions of Apache Airflow Providers _No response_ ### Deployment Official Apache Airflow Helm Chart ### Deployment details _No response_ ### Anything else? _No response_ ### Are you willing to submit PR? - [ ] 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) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
