cpu_index_tuple_cost
| 버전 | 기본값 | context | 타입 |
|---|---|---|---|
| 14 | 0 | user | string |
| 15 | 0 | user | string |
| 16 | 0 | user | string |
| 17 | 0 | user | string |
| 18 | 0 | user | string |
| 19 | 0 | user | string |
index scan 중 index entry 하나를 처리하는 비용을 planner가 얼마로 추정할지 정한다. 기본값은 0.005다.
cost 모델 안에서 이 값은 index scan의 CPU 쪽 비용을 구성한다. index scan의 총 cost는 인덱스와 테이블 page를 읽는 I/O 비용(random_page_cost 등)에, 방문한 index entry 수 × cpu_index_tuple_cost, 가져온 row 수 × cpu_tuple_cost, 조건 비교에 쓰인 operator 수 × cpu_operator_cost를 더하는 식으로 계산된다. 기본값 기준으로 index entry 처리 비용은 row 처리 비용(cpu_tuple_cost = 0.01)의 절반으로 잡혀 있다.
운영 노트: 이 값을 단독으로 조정하는 일은 거의 없다. index scan과 sequential scan 사이의 선택에 영향을 주고 싶다면
random_page_cost 조정이 먼저고, cpu_* 계열은 서로 간의 기본 비율을 유지하는 편이 안전하다.출처: PostgreSQL 18 문서