Skip to content

Conversation

avamingli
Copy link
Contributor

@avamingli avamingli commented May 14, 2025

This commit refines the existing implementation of the extend protocol in libpq, focusing on changes to data types and processing mechanisms. The main adjustments include a transition from generic data handling to a strict binary data format for improved efficiency and clarity in data transmission. This change ensures that the protocol explicitly handles binary data, enhancing performance during execution.

Before this commit

Extend protocol:

Description

After this commit

Extend protocol:

Description

Protocol processing between QD and QE:

Description

Additionally, the process for receiving and managing binary data within the ExtendProtocolData structure has been streamlined. Each received message is now parsed into a structured format that includes subtags, allowing for more efficient data organization and retrieval.

Memory management continues to utilize TopTransactionContext for storing binary data, ensuring optimal usage while simplifying cleanup during data consumption. Adjustments to the ConsumeExtendProtocolData() function reflect these changes, ensuring that binary data is efficiently marked as consumed and appropriately cleaned up.

Overall, this refactor enhances the extend protocol's capability to manage binary data more effectively, improving the overall performance and reliability of data transmission between the QE and QD.

Authored-by: Zhang Mingli avamingli@gmail.com

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 commit refines the existing implementation of the extend protocol
in libpq, focusing on changes to data types and processing mechanisms.
The main adjustments include a transition from generic data handling to
a strict binary data format for improved efficiency and clarity in data
transmission. This change ensures that the protocol explicitly handles
binary data, enhancing performance during execution.

Additionally, the process for receiving and managing binary data within
the `ExtendProtocolData` structure has been streamlined. Each received
message is now parsed into a structured format that includes subtags,
allowing for more efficient data organization and retrieval.

Memory management continues to utilize `TopTransactionContext` for
storing binary data, ensuring optimal usage while simplifying cleanup during
data consumption. Adjustments to the `ConsumeExtendProtocolData()`
function reflect these changes, ensuring that binary data is efficiently
marked as consumed and appropriately cleaned up.

Overall, this refactor enhances the extend protocol's capability to
manage binary data more effectively, improving the overall performance
and reliability of data transmission between the QE and QD.

Authored-by: Zhang Mingli avamingli@gmail.com
@avamingli avamingli merged commit 9223de8 into apache:main May 16, 2025
26 checks passed
@avamingli avamingli deleted the dev branch May 16, 2025 01: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.

3 participants