Skip to content

Conversation

@avamingli
Copy link
Contributor

This commit optimizes the materialized view (MV) invalidation mechanism to reduce overhead in OLTP workloads. The AQUMV feature introduced SetRelativeMatviewAuxStatus() to invalidate MVs at appropriate times, which GP7 lacks. However, TPC-B testing showed this function adds ~8.72% OLTP overhead due to mandatory metadata operations, even when no MVs are present.

20250401-124730

20250401-124738

To address this, we added relmvrefcount to track the number of MVs dependent on a table. When no MVs reference a table, the system now skips SetRelativeMatviewAuxStatus() entirely, avoiding unnecessary catalog access. Benchmark results demonstrate significant improvements: under 20 concurrent connections, transactions increased from 373,511 to 404,976, latency decreased from 16.06ms to 14.813ms, and TPS improved from 1,245.3 to 1,350.2.

This optimization restores performance parity with GP7 in MV-free scenarios while maintaining correctness for tables with MVs, delivering measurable throughput gains and reduced latency in high-concurrency OLTP workloads.

Authored-by: Zhang Mingli [email protected]

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


@avamingli avamingli requested a review from my-ship-it April 1, 2025 04:49
Copy link
Contributor

@my-ship-it my-ship-it left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@my-ship-it my-ship-it requested review from weinan003 and yjhjstz April 1, 2025 05:47
@yjhjstz
Copy link
Member

yjhjstz commented Apr 2, 2025

LGTM, except CI

This commit optimizes the materialized view (MV) invalidation mechanism
to reduce overhead in OLTP workloads. The AQUMV feature introduced
`SetRelativeMatviewAuxStatus()` to invalidate MVs at appropriate times,
which GP7 lacks. However, TPC-B testing showed this function adds ~8.72%
OLTP overhead due to mandatory metadata operations, even when no MVs are
present.

To address this, we added `relmvrefcount` to track the number of MVs
dependent on a table. When no MVs reference a table, the system now
skips `SetRelativeMatviewAuxStatus()` entirely, avoiding unnecessary
catalog access. Benchmark results demonstrate significant improvements:
under 20 concurrent connections, transactions increased from 373,511 to
404,976, latency decreased from 16.06ms to 14.813ms, and TPS improved
from 1,245.3 to 1,350.2.

This optimization restores performance parity with GP7 in MV-free
scenarios while maintaining correctness for tables with MVs, delivering
measurable throughput gains and reduced latency in high-concurrency OLTP
workloads.

Authored-by: Zhang Mingli [email protected]
@my-ship-it my-ship-it merged commit 77863a6 into main Apr 3, 2025
22 checks passed
@my-ship-it my-ship-it deleted the mcrelcount branch April 3, 2025 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants