Skip to content

Optimize AOCS scan performance by introducing specialized no-qual path#1009

Closed
yjhjstz wants to merge 1 commit intoapache:mainfrom
yjhjstz:opt_aocs
Closed

Optimize AOCS scan performance by introducing specialized no-qual path#1009
yjhjstz wants to merge 1 commit intoapache:mainfrom
yjhjstz:opt_aocs

Conversation

@yjhjstz
Copy link
Member

@yjhjstz yjhjstz commented Mar 26, 2025

This patch improves the performance of Append-Only Columnar Store (AOCS) table scans by introducing aocs_getnext_noqual, a specialized scan function optimized for cases where no scan qualifiers are present. This change helps avoid unnecessary checks, reducing CPU overhead during sequential scans.

Key changes:

  • Added aocs_getnext_noqual, which eliminates redundant checks in scans.
  • Marked upgrade_datum_scan as pg_attribute_unused() to suppress unused warnings.
  • Introduced pg_attribute_hot_inline for aocs_getnext_noqual to improve inlining efficiency.
  • Refactored related scan functions to integrate the optimized path while maintaining correctness.

These changes are expected to improve scan efficiency for AOCS tables, especially for full-table sequential scans.

Author: Jianghua Yang

Fixes #ISSUE_Number

What does this PR do?

Type of Change

  • Bug fix (non-breaking change)
  • New feature (non-breaking change)
  • Breaking change (fix or feature with breaking changes)
  • Documentation update

Breaking Changes

Test Plan

  • Unit tests added/updated
  • Integration tests added/updated
  • Passed make installcheck
  • Passed make -C src/test installcheck-cbdb-parallel

Impact

Performance:

User-facing changes:

Dependencies:

Checklist

Additional Context

CI Skip Instructions


This patch improves the performance of Append-Only Columnar Store (AOCS) table
scans by introducing `aocs_getnext_noqual`, a specialized scan function optimized
for cases where no scan qualifiers are present. This change helps avoid unnecessary
checks, reducing CPU overhead during sequential scans.

Key changes:
- Added `aocs_getnext_noqual`, which eliminates redundant checks in scans.
- Marked `upgrade_datum_scan` as `pg_attribute_unused()` to suppress unused warnings.
- Introduced `pg_attribute_hot_inline` for `aocs_getnext_noqual` to improve inlining efficiency.
- Refactored related scan functions to integrate the optimized path while maintaining correctness.

These changes are expected to improve scan efficiency for AOCS tables,
especially for full-table sequential scans.

Author: Jianghua Yang
@yjhjstz yjhjstz added the type: Performance cloudberry runs slow on some particular query label Mar 26, 2025
@yjhjstz
Copy link
Member Author

yjhjstz commented Mar 26, 2025

move to #1010

@yjhjstz yjhjstz closed this Mar 26, 2025
@yjhjstz yjhjstz deleted the opt_aocs branch November 17, 2025 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: Performance cloudberry runs slow on some particular query

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant