Skip to content

[v3-2-test] Update search parameters to better leverage DB indexes#65964

Merged
pierrejeambrun merged 1 commit into
apache:v3-2-testfrom
astronomer:backport-64963
Apr 28, 2026
Merged

[v3-2-test] Update search parameters to better leverage DB indexes#65964
pierrejeambrun merged 1 commit into
apache:v3-2-testfrom
astronomer:backport-64963

Conversation

@pierrejeambrun
Copy link
Copy Markdown
Member

Backport of #64963 to v3-2-test.

Cherry-picked from 7336ed4.

Clean cherry-pick, no conflicts.


Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Opus 4.7)

Generated-by: Claude Code (Opus 4.7) following the guidelines

* API: Use prefix matching for REST list search parameters

Search query parameters on list endpoints now use prefix matching (LIKE 'value%') instead of substring search, which allows the database to use indexes more effectively.

This is a breaking change for clients that relied on matching arbitrary substrings in names and identifiers. Regenerate OpenAPI specs and UI client types accordingly.

* API: Add index-friendly *_prefix_pattern query params (non-breaking)

Keep the existing *_pattern substring filters unchanged and add
parallel *_prefix_pattern variants that use a B-tree-friendly
range comparison, so large deployments can filter list endpoints
without paying for a full table scan.

Drop custom TaskDisplayName substring class; replace feature newsfragment with significant

Full-match on ``coalesce(...)`` can't use an index anyway, so the
custom ``_TaskDisplayNamePatternParam`` class adds nothing over a
plain ``_SearchParam``: use ``search_param_factory`` directly for
the substring variant and keep the custom prefix variant since the
split on ``IS NULL`` is what makes the B-tree index apply.

Swap 64963.feature for 64963.significant to flag the user-visible
UI change (search-as-you-type is now prefix-based, not substring).

Fix CI

Fix CI

* UI: Fix connections search e2e fixtures for prefix-match API

The fixtures had names like search_production_<ts> but the UI search now
hits the prefix-match API (connection_id_prefix_pattern). Move the
environment word to the front (production_search_<ts>, staging_search_<ts>,
development_search_<ts>) so "production" is a valid prefix.

(cherry picked from commit 7336ed4)
@boring-cyborg boring-cyborg Bot added area:API Airflow's REST/HTTP API area:UI Related to UI/UX. For Frontend Developers. labels Apr 27, 2026
@pierrejeambrun pierrejeambrun merged commit 065e04c into apache:v3-2-test Apr 28, 2026
110 checks passed
@pierrejeambrun pierrejeambrun deleted the backport-64963 branch April 28, 2026 07:58
@vatsrahul1001 vatsrahul1001 added this to the Airflow 3.2.2 milestone May 18, 2026
@vatsrahul1001 vatsrahul1001 added the type:misc/internal Changelog: Misc changes that should appear in change log label May 18, 2026
vatsrahul1001 pushed a commit that referenced this pull request May 20, 2026
* API: Use prefix matching for REST list search parameters

Search query parameters on list endpoints now use prefix matching (LIKE 'value%') instead of substring search, which allows the database to use indexes more effectively.

This is a breaking change for clients that relied on matching arbitrary substrings in names and identifiers. Regenerate OpenAPI specs and UI client types accordingly.

* API: Add index-friendly *_prefix_pattern query params (non-breaking)

Keep the existing *_pattern substring filters unchanged and add
parallel *_prefix_pattern variants that use a B-tree-friendly
range comparison, so large deployments can filter list endpoints
without paying for a full table scan.

Drop custom TaskDisplayName substring class; replace feature newsfragment with significant

Full-match on ``coalesce(...)`` can't use an index anyway, so the
custom ``_TaskDisplayNamePatternParam`` class adds nothing over a
plain ``_SearchParam``: use ``search_param_factory`` directly for
the substring variant and keep the custom prefix variant since the
split on ``IS NULL`` is what makes the B-tree index apply.

Swap 64963.feature for 64963.significant to flag the user-visible
UI change (search-as-you-type is now prefix-based, not substring).

Fix CI

Fix CI

* UI: Fix connections search e2e fixtures for prefix-match API

The fixtures had names like search_production_<ts> but the UI search now
hits the prefix-match API (connection_id_prefix_pattern). Move the
environment word to the front (production_search_<ts>, staging_search_<ts>,
development_search_<ts>) so "production" is a valid prefix.

(cherry picked from commit 7336ed4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:API Airflow's REST/HTTP API area:UI Related to UI/UX. For Frontend Developers. type:misc/internal Changelog: Misc changes that should appear in change log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants