> For the complete documentation index, see [llms.txt](https://docs.tibero.com/tmaxopensql/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tibero.com/tmaxopensql/tmax-o2-extensions/troubleshooting/large-data.md).

# Large Data 처리 가이드

## BLOB/CLOB <- TEXT, BYTEA

* 1GB 이하
* TOAST에 의존합니다.
  * PostgreSQL의 각 page영역은 일반적으로 8kb의 고정된 크기로 되어있고 각 tuple이 여러 페이지에 나뉘어 존재할 수 없습니다. (매우 큰 값을 바로 저장할 수 없습니다.)

    이 한계를 극복하기 위해서, 큰 필드 값은 압축되어 저장되거나 여러 개의 물리적 ROWS로 분할되어 저장됩니다.
  * 이 기법을 TOAST (The Oversized-Attribute Storage Technique)라고 하며 PostgreSQL에서 큰 데이터 값을 메모리 내에서 효율적으로 처리하는 데에 사용됩니다.

***

## Large Object

* 4TB 이하
* 특징
  * 파일에 대한 표준 작업과 유사한 읽기/쓰기 API를 사용하여 생성, 수정 및 삭제할 수 있습니다.
  * 대형 개체의 일부를 읽고 업데이트하는 작업을 효율적으로 수행할 수 있는 반면 TOAST 로 처리된 필드의 대부분 작업은 전체 값을 단위로 읽거나 씁니다.
  * Chunk로 쪼개고 DB에 row로 저장. B-tree로 chunk index 탐색 가능하게 합니다.
* 참고
  * <https://www.postgresql.org/docs/current/largeobjects.html>

***

## Migration 가이드

오라클의 LOB은 4GB까지 지원하는 반면, O2의 LOB은 TEXT, BYTEA 타입에 기반하기 때문에 1GB까지 지원합니다. 따라서 1GB 넘는 데이터 이관 시에는 PostgreSQL의 Large Object를 사용해야 합니다.

* Large Object 이관에 필요한 API 참고 문서\
  <https://www.postgresql.org/docs/16/largeobjects.html>

###


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.tibero.com/tmaxopensql/tmax-o2-extensions/troubleshooting/large-data.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
