-
Notifications
You must be signed in to change notification settings - Fork 124
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-25541] Fixed unnecessary heap operations in show access status by passing NULL to the class_oid parameter #5613
base: develop
Are you sure you want to change the base?
Conversation
…tart and heap_next functions from NULL to the address of class_oid
src/connection/connection_support.c
Outdated
@@ -2774,7 +2774,7 @@ css_make_access_status_exist_user (THREAD_ENTRY * thread_p, OID * class_oid, LAS | |||
|
|||
while (true) | |||
{ | |||
scan = heap_next (thread_p, &hfid, NULL, &inst_oid, &recdes, &scan_cache, PEEK); | |||
scan = heap_next (thread_p, &hfid, class_oid, &inst_oid, &recdes, &scan_cache, PEEK); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
heap_scancache_start() 함수를 통해 scan_cache->node.class_oid에 class_oid 정보가 저장됩니다. heap_next_internal 함수를 보면 scan_cache->node.class_oid 정보를 체크하도록 되어 있습니다. 그럼에도 불구하고 heap_next()에 NULL이 아닌 class_oid 정보를 넘겨주어야 하는 이유가 있을까요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NULL값을 넘겨주게 되면 8151 라인에서 *next_oid에 oid를 할당해주는 작업을 하고, heap연산을 다시 수행합니다.
하지만, class_oid의 값을 넘겨주게 되면 추가로 할당해주는 작업 없이 heap 연산을 수행하므로 불필요한 연산을 하지 않게 됩니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
정정합니다. heap_scancache_start() 함수에서 class_oid 값이 저장되기 때문에 heap_next() 함수에 class_oid를 NULL로 전달하여도 class_oid를 식별하기에는 문제가 없습니다.
2777 라인은 변경하지 않도록 코드 반영하겠습니다.
http://jira.cubrid.org/browse/CBRD-25541