steveahnahn opened a new pull request, #61570:
URL: https://github.com/apache/airflow/pull/61570

   ## Summary
   Optimize the public bulk connections API by removing N+1 DB queries during 
bulk update and bulk delete. Bulk update/delete previously performed an 
additional SELECT per connection ID, which scales linearly with request size 
and adds avoidable latency and database load.
   
   The service now reuses the already-fetched connections from 
categorize_connections() instead of re-querying each connection inside the loop.
   ## Changes
   - Reuse existed_connections_dict from categorize_connections() in 
handle_bulk_update() / handle_bulk_delete() to avoid per-entity selects
   - Add unit tests asserting bulk update/delete perform a single lookup query 
(no N+1 regression)


-- 
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]

Reply via email to