CData Virtuality Server は、さまざまな操作のためにいくつかのタイプの組み込みスカラー関数を提供します。ここではアルファベット順にご紹介します:
サポートされているビルドイン関数と関数パラメータは、SYS.Functions とSYS.FunctionParams テーブルにあります。
CData Virtuality Server におけるスカラー関数の特徴は、決定性の度合いが異なることです。これは、関数の決定性の度合いによって、関数が評価されるタイミングや結果がキャッシュされる範囲が決まるため重要です。CData Virtuality Server には、5つの機能決定レベルがあります:
| | |
---|
Deterministic | - The function will always return the same result for the given inputs;
- Deterministic functions are evaluated by the engine as soon as all input values are known, which may occur as soon as the rewrite phase;
- Some functions are not truly deterministic but are treated as such for performance
| All except listed below |
User Deterministic | - The function will return the same result for the given inputs for the same user;
- User deterministic functions are evaluated by the engine as soon as all input values are known, which may occur as soon as the rewrite phase;
- If a user deterministic function is evaluated during the creation of a prepared processing plan, then the resulting plan will be cached only for the user
| HASCALLERROLE
CALLER
|
Session Deterministic | - The function will return the same result for the given inputs under the same user session;
- Session deterministic functions are evaluated by the engine as soon as all input values are known, which may occur as soon as the rewrite phase;
- If a session deterministic function is evaluated during the creation of a prepared processing plan, then the resulting plan will be cached only for the user's session
| ENV
|
Command Deterministic | - The result of function evaluation is only deterministic within the scope of the user command;
- Command deterministic functions are delayed in evaluation until processing to ensure that even prepared plans utilizing these functions will be executed with relevant values;
- Command deterministic function evaluation will occur before pushdown - however, multiple occurrences of the same command deterministic time function are not guaranteed to evaluate to the same value
| CURDATE
CURTIME
NOW
|
Nondeterministic | - The result of function evaluation is fully nondeterministic;
- Nondeterministic functions are delayed in evaluation until processing with a preference for pushdown;
- If the function is not pushed down, then it may be evaluated for every row in its execution context (for example, if the function is used in the
SELECT clause)
| RAND
HASROLE
USER
|