Skip to content

[CBRD-26547] Support OOS in Covered Index (midxkey)#6844

Open
vimkim wants to merge 1 commit intoCUBRID:feat/oosfrom
vimkim:oos-midxkey
Open

[CBRD-26547] Support OOS in Covered Index (midxkey)#6844
vimkim wants to merge 1 commit intoCUBRID:feat/oosfrom
vimkim:oos-midxkey

Conversation

@vimkim
Copy link
Contributor

@vimkim vimkim commented Feb 12, 2026

http://jira.cubrid.org/browse/CBRD-26547

Purpose

현재 covered index (midxkey) 에서는 OOS 값을 읽어올 수 없다.
midxkey 생성 시 OOS OID 대신 OOS 값을 넣도록 개선한다.

Implementation

heap_midxkey_get_value 함수는 현재 (예찬님이 리팩토링한) heap_attrvalue_point_variable() 함수로 되어 있지 않고 직접
OR_FIXED_ATTRIBUTES_OFFSET_BY_OBJ () 매크로를 통해 접근하는 방식으로 raw하게 구현되어 있다.

이를 heap_attrvalue_point_variable() 함수를 사용해 현대적인 방법으로 개선한다.

OOS에서는 heap_attrvalue_point_value() 함수 내부에서 IS_OOS를 값으로 바꿔주므로 이를 통해 midxkey 또한 OOS 값을 담도록 개선할 수 있다.

Remarks

How to Reproduce

disable string compression.

drop if exists tbl;
create table tbl (id int, vc varchar);
create index vc_idx on tbl (id, vc);
insert into tbl (id, vc) values (1, REPEAT('abcdeabcde', 200));

-- can read oos
select id, vc from tbl;

-- cannot read oos, empty result
select id, vc from tbl where id >= 0;

AS-IS

image

select id, vc from tbl where id > 0;
쿼리의 경우, vc 가 ''으로 빈 string 값이 나온다.

TO-BE

값이 정상적으로 잘 나온다.

@vimkim vimkim requested a review from hornetmj as a code owner February 12, 2026 07:43
@vimkim vimkim requested review from a team, H2SU, InChiJun, YeunjunLee, Copilot, hgryoo, hornetmj, hyahong and youngjun9072 and removed request for a team and hornetmj February 12, 2026 07:43
@vimkim vimkim self-assigned this Feb 12, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates covered-index (midxkey) value extraction so that out-of-slot stored (OOS) variable-length values are correctly materialized into the generated midxkey, enabling covered index scans to return the correct column values instead of empty strings.

Changes:

  • Refactors heap_midxkey_get_value to use heap_attrvalue_point_fixed/variable instead of manual fixed/var offset access.
  • Enables OOS materialization for variable attributes by propagating the OOS read path and ensuring the read DB_VALUE is safe after freeing the OOS buffer.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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