[PostgreSQL] LANGUAGE, VOLATILE, COST 100

Yuri Lee·2021년 5월 12일
0

LANGUAGE

무슨 언어 사용하는지 나타낸다.

VOLATILE

모든 함수가 가지고 있는 속성. default로 적용된다.

VOLATILE indicates that the function value can change even within a single table scan, so no optimizations can be made. Relatively few database functions are volatile in this sense; some examples are random(), currval(), timeofday(). But note that any function that has side-effects must be classified volatile, even if its result is quite predictable, to prevent calls from being optimized away; an example is setval().

VOLATILE은 단일 테이블 스캔 내에서도 함수 값이 변경 될 수 있으므로 최적화 할 수 없음을 나타낸다. 이러한 의미에서 휘발성이있는 데이터베이스 기능은 상대적으로 거의 없다. 몇 가지 예는 random (), currval (), timeofday ()이다. 그러나 부작용이있는 함수는 호출이 최적화되는 것을 방지하기 위해 결과가 상당히 예측 가능하더라도 휘발성으로 분류되어야 한다.

VOLATILE:-In PostgreSQL Every function has a volatility classification and volatile is one of volatility classification. A VOLATILE function can do anything, including modifying the database. It is default, so it can be omitted.

In PostgreSQL 모든 함수에는 변동성 분류가 있으며 휘발성은 변동성 분류 중 하나이다. VOLATILE 함수는 데이터베이스 수정을 포함하여 모든 작업을 수행 할 수 있다. 기본값이므로 생략 할 수 있다.

COST 100

COST 100:- COST is completely independent from VOLATILE. It declares the cost per row of the result, which is used by the query planner to find the cheapest plan. The default is COST 100 which also can be omitted. Its better to leave it at the default.

VOLATILE과 완전히 독립적이다. 쿼리 플래너가 가장 저렴한 계획을 찾는 데 사용하는 결과의 행당 비용을 선언한다. 기본값은 COST 100이며 생략 할 수도 있다. 기본값으로 두는 것이 좋다.

각 row를 처리하는 데 드는 기본 비용. default로 적용된다. query planner가 가장 싼 plan을 찾을 때 사용된다.


https://teraphonia.tistory.com/688
https://stackoverflow.com/questions/12577004/what-does-language-plpgsql-volatile-mean
https://stackoverflow.com/questions/21673394/what-does-language-plpgsql-volatile-cost-100-mean-in-functions

profile
Step by step goes a long way ✨

0개의 댓글