[Feature](PreparedStatement) implement general server side prepared#33807
[Feature](PreparedStatement) implement general server side prepared#33807xiaokang merged 11 commits intoapache:masterfrom
Conversation
|
Thank you for your contribution to Apache Doris. Since 2024-03-18, the Document has been moved to doris-website. |
|
run buildall |
| class GolobalColumnTree { | ||
| public: | ||
| GolobalColumnTree() = default; | ||
| void register_column(const vectorized::PathInData& path, const RowsetId& rowset_id, |
There was a problem hiding this comment.
warning: method 'register_column' can be made static [readability-convert-member-functions-to-static]
| void register_column(const vectorized::PathInData& path, const RowsetId& rowset_id, | |
| static void register_column(const vectorized::PathInData& path, const RowsetId& rowset_id, |
| std::lock_guard<std::mutex> lock(_lock); | ||
| } | ||
| // return nullptr if not found | ||
| const SubcolumnReader* get_reader(const vectorized::PathInData& path, RowsetId rowset_id, |
There was a problem hiding this comment.
warning: method 'get_reader' can be made static [readability-convert-member-functions-to-static]
| const SubcolumnReader* get_reader(const vectorized::PathInData& path, RowsetId rowset_id, | |
| static const SubcolumnReader* get_reader(const vectorized::PathInData& path, RowsetId rowset_id, |
87afb69 to
b9ca2b0
Compare
|
run buildall |
|
clang-tidy review says "All clean, LGTM! 👍" |
1 similar comment
|
clang-tidy review says "All clean, LGTM! 👍" |
|
TeamCity be ut coverage result: |
|
clang-tidy review says "All clean, LGTM! 👍" |
|
run buildall |
|
TeamCity be ut coverage result: |
TPC-H: Total hot run time: 41856 ms |
TPC-DS: Total hot run time: 185847 ms |
|
PR approved by at least one committer and no changes requested. |
|
PR approved by anyone and no changes requested. |
|
run buildall |
|
clang-tidy review says "All clean, LGTM! 👍" |
|
run buildall |
|
clang-tidy review says "All clean, LGTM! 👍" |
TPC-DS: Total hot run time: 188249 ms |
|
TeamCity be ut coverage result: |
|
run buildall |
|
clang-tidy review says "All clean, LGTM! 👍" |
|
TeamCity be ut coverage result: |
TPC-DS: Total hot run time: 186550 ms |
|
run buildall |
|
clang-tidy review says "All clean, LGTM! 👍" |
TPC-H: Total hot run time: 40720 ms |
|
TeamCity be ut coverage result: |
TPC-DS: Total hot run time: 185317 ms |
|
PR approved by at least one committer and no changes requested. |
Description:
This commit marks the initial step towards integrating a server-side prepared statement feature into the original planner, set to be implemented in Nereids soon.
Background:
Previously, we added support for prepared statements for point query and insert statements in #15491, aimed at enhancing front-end performance by introducing basic server-side prepared statement functionality. However, certain scenarios necessitate server-side prepared statements to ensure compatibility with Business Intelligence (BI) tools.
Details:
This pull request introduces a general prepared statement mechanism for all query types, including point queries. The implementation aligns with the MySQL protocol's server-side prepared statement workflow, which involves two phases:
The first phase involves sending the PREPARE command to Doris, wherein statements with placeholders (e.g., SELECT * FROM tbl WHERE k = ?) are analyzed and cached.
Subsequently, the EXECUTE command is sent to Doris, utilizing the statement ID to retrieve the previously cached statement.
Types of Prepared Statements:
This implementation supports three types of prepared statements:
This enhancement aims to improve query performance and compatibility with BI tools by leveraging server-side prepared statements across various query types.
Proposed changes
Issue Number: close #xxx
Further comments
If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...