hussein-awala opened a new pull request, #76001: URL: https://github.com/apache/airflow/pull/76001
Listing a small page of assets currently aggregates the complete event history before returning the latest event for each asset. On PostgreSQL and SQLite, this change filters, sorts, and paginates assets first, then uses the existing asset/timestamp index to look up each returned asset's latest event. The latest timestamp still wins, with the highest event ID breaking timestamp ties. Assets without events, permissions, ordering, pagination, and relationship loading retain their existing behavior. MySQL keeps its original aggregation query because its grouped index plan performs better there. No schema migration is needed. Warm PostgreSQL 14 main-query measurements (five alternating base/head samples, five executions per sample): | Fixture and page | Before | After | | --- | ---: | ---: | | 404 assets, 400,002 events; first 10 assets | 42.213 ms | 0.323 ms | | 4,004 assets, 4,002 events; first 10 assets | 3.339 ms | 0.322 ms | | 4,004 assets, 4,002 events; offset 4,000 | 4.453 ms | 0.620 ms | | 8 assets, 18 events; first page | 0.263 ms | 0.278 ms | The unchanged control varied by less than 5% for these cases. These are synthetic SQL execution and materialization timings, not HTTP latency measurements. MySQL SQL was compared with the base query and is identical; no MySQL or UI performance improvement is claimed. Validation: - Focused asset-list tests: 53 passed on SQLite, and 52 passed with one SQLite-only test skipped on each of PostgreSQL and MySQL. The SQLite query-plan regression fails on the base query. Integration cases cover filters, deterministic ordering, timestamp ties, out-of-order IDs, empty histories, and orphan events. - Selected API/Always suites: 6,515 database tests passed, plus 1,259 non-database tests passed and one expected failure. - Selected common.compat/FAB suites: 415 database tests and 622 non-database tests passed. - Airflow, common.compat, and FAB documentation built successfully as separate package builds to fit the local VM's memory limit. - Regular and manual static checks passed, including mypy and OpenAPI generation. --- ##### Was generative AI tooling used to co-author this PR? - [X] Yes — Codex (GPT-6) Generated-by: Codex (GPT-6) following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions) --- Drafted-by: Codex (GPT-6) (no human review before posting) -- 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]
