-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CBRD-25997] Skip end_one_iteration when it's possible in parallel heap scan #6091
Open
xmilex-git
wants to merge
19
commits into
CUBRID:feature/parallel_query
Choose a base branch
from
xmilex-git:phs_list_merge_feature
base: feature/parallel_query
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
[CBRD-25997] Skip end_one_iteration when it's possible in parallel heap scan #6091
xmilex-git
wants to merge
19
commits into
CUBRID:feature/parallel_query
from
xmilex-git:phs_list_merge_feature
+1,646
−361
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://jira.cubrid.org/browse/CBRD-25447 To improve the performance of heap scan, we plan to add a parallel heap scan feature to CUBRID. The following improvements that have not yet been completed will be handled in separate improvement issues/PRs. • Trace output • Modify the query to allow specifying the number of threads using a query hint, e.g., select /*+ parallel(4) */ * from t1; • Store the results separately in individual list files for each parallel task thread, to be later merged or used as needed
… 출력, 평균값을 출력하도록 리팩토링
…우 row by row로 작동하게 변경
…hs_list_merge_feature
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
http://jira.cubrid.org/browse/CBRD-25997
Purpose
기존에는 병렬 힙 스캔 수행 후, 메인 스레드가 각 스레드로부터 결과를 한 건씩 받아 xasl->list_id에 추가하는 방식으로 처리되었습니다. 그러나 이 방식은 첨부된 그래프에서 확인할 수 있듯이 성능 저하가 큽니다.
이에 따라, 병렬 힙 스캔을 수행한 스레드에서 생성한 임시 결과 파일을 별도의 병합 없이 그대로 클라이언트에 반환하거나 쿼리의 결과로 사용할 수 있도록 개선하였습니다.
병렬 힙 스캔 수행 시 다음 조건을 모두 만족하는 경우, end_one_iteration 등의 후처리를 생략하고 병렬 힙 스캔 스레드에서 생성한 임시 결과 파일을 최종 결과로 바로 반환하도록 동작이 수정됩니다.
대표적인 적용 예시
Implementation
scan_next_parallel_heap_scan()에서 LIST_MERGE 방식으로 결과를 처리하는 parallel heap scan manager가 존재하는 경우, 자식 스레드가 모두 종료될 때까지 대기한 후 리스트 병합(list merging)을 수행하고, S_END를 반환하여 end_one_iteration이나 추가적인 pred 평가 과정을 생략합니다.
이때 xasl->list_id에 저장된 리스트는 병합된 결과 리스트로 대체됩니다.
Remarks