setDefaultOptionValue/getDefaultOptionValue
$NOOPT
、$PREFER_DWH
、$ALLOW_CARTESIAN
の Default-Option およびデフォルト値は、以下の手順で変更できます:
SYSADMIN.setDefaultOptionValue(
IN
opt string
NOT
NULL
,
IN
val string,
IN
encVal string)
と表示されます:
SYSADMIN.getDefaultOptionValue(
IN
opt string
NOT
NULL
)
詳しくはSystem Proceduresをご覧ください。
以下はその留意点です:
- Default値は、特定のクエリのDefault Optionsや、現在のセッションの
SET
Statement、明示的に上書きすることができます; setDefaultOptionValue
を介して変更された Default Option 値は、変更後に新しく開かれたセッションの CData Virtuality Server の動作に影響します。実際のセッションの値を変更するには、SET
Statementを使用します;ALLOW_INDEX_RECOMMENDATION
とALLOW_INDEX_CREATION
の Default Option 値がsetDefaultOptionValue
経由で変更されると、CData Virtuality Server の動作に、現在のセッションを含めて直ちに影響します;<optionname>
setDefaultOptionValue()と の両方をドル記号なしで渡す必要があります ( )。
getDefaultOptionValue()
$
Encrypted default options are available since v4.5
Default-only Options
これらのオプションは、setDefaultOptionValue
。
ALLOW_INDEX_RECOMMENDATION
このオプションは、クエリ処理時に推奨インデックスがどのように作成されるかを制御します。以下の値を持つことができます:
Value | Description |
---|---|
| All recommended/physical indexes are automatically created; default |
| Only recommended/physical indexes with type |
| Only recommended/physical indexes with type |
| No indexes are created |
ALLOW_INDEX_CREATION
このOPTIONは、Optimizationsが有効化され、Materializedされた場合に、対応するMaterialized Tableに対してどのように物理インデックスが作成されるかを制御します。以下の値を持つことができます:
Value | Description |
---|---|
| All recommended/physical indexes are automatically created; default |
| Only recommended/physical indexes with type |
| Only recommended/physical indexes with type |
| Only recommended indexes manually generated using the |
| No indexes are created |
ALLOW_INDEX_CREATION
オプションの値の組み合わせを CSV 形式で提供できます。例えば、WHERE, JOIN
、またはJOIN, MANUAL
。ALL
、NONE
、他の値と組み合わせることはできません(例えば、ALL, JOIN
は有効な値ではありません)。
MANUAL
インデックスに関しては、SYSADMIN.createIndex()
またはSYSADMIN.importIndex()
ストアドプロシージャを使用して作成することができます。以下はその例です:
CALL SYSADMIN.createIndex(3,
''
,
'test_tables.test_b.c'
,
'MANUAL'
,
NULL
)
CALL SYSADMIN.importIndex(3,
''
,
'test_tables.test_b.c'
,
'MANUAL'
,
NULL
)
create
とimport
手続の主な違いは、前者はマテリアライズド・テーブルに推奨インデックスと物理インデックスを作成しますが、後者は推奨インデックスのみを作成することです。
詳しくはSystem Proceduresをご覧ください。
ALLOW_MAT_AGGR
このオプションは、MAT_AGGR
s の生成と書き換えを有効/無効にします。デフォルト値はFALSE
です。
ALLOW_MAT_JOIN
このオプションは、MAT_JOIN
s の生成と書き換えを有効/無効にします。デフォルト値はFALSE
です。
SKIP_STRUCTURE_CHECKING
このオプションは、Materialized tables構造の検証を制御し、以下の値を指定できます:
Value | Description |
---|---|
| Structure check is enabled |
| Structure check is disabled; default |
構造検証アルゴリズムは、マテリアライズド・テーブルとそのソース・テーブルの対応関係をチェックし、さらに使用できるかどうかを確認するために使用されます。これは、以下を確認することで行われます:
- 構造の変更(1つ以上のカラムの追加、削除、名前の変更);
- データ型の不一致(1つ以上の列の型が変更されています)。
構造の変更については、ソース・テーブル(または結合)を対応するマテリアライズド・テーブルに書き換える前に、現在のクエリを実行するために必要なすべての列がマテリアライズド・テーブルに存在するかどうかをチェックします。システムが互換性のない構造の変更を検出した場合、ソースと同期されるべき特定のマテリアライズド・テーブルに関する情報を提供するエラー・メッセージが生成されます。
Example
CALL SYSADMIN.setDefaultOptionValue(
'SKIP_STRUCTURE_CHECKING'
,
'FALSE'
);
ワークフロー例
CREATE
TABLE
ds.test1 (a
integer
);
INSERT
INTO
ds.test1
VALUES
(1);
SELECT
*
FROM
ds.test1;
-- materialize the source table ds.test1
-- add the column b to the source table
DROP
TABLE
ds.test1;
CREATE
TABLE
ds.test1 (a
integer
, b
integer
);
INSERT
INTO
ds.test1
VALUES
(1,1);
-- selecting all the columns from the source table will throw an exception since the column "b" is not found in the mat table
SELECT
*
FROM
ds.test1;
-- selecting only the column "a" from the source will correctly work
SELECT
a
FROM
ds.test1;
-- to fully synchronize the materialized table with the source, a full re-materialization of the optimization is needed
Optimizationが単一テーブルではなく結合に関連する場合も同様です。
データ型の不一致チェックはデータ型に関連しています。このアルゴリズムは、ソース列のデータ型がマテリアライズド・テーブルの列データ型と同じかどうかを検出します。システムが不一致を検出した場合、予期されるデータ型と実際のデータ型、ソース・テーブルとマテリアライズド・テーブルの列名、マテリアライズド・テーブル名とソース・テーブル名に関する情報を提供する例外がスローされます。
ワークフロー例
CREATE
TABLE
ds.test1 (a
integer
)
INSERT
INTO
ds.test1
VALUES
(1)
-- enable the optimization
DROP
TABLE
ds.test1;
CREATE
TABLE
ds.test1 (a
double
);
INSERT
INTO
ds.test1
VALUES
(1.1);
-- selecting data from the source table will throw an data type mismatch exception
SELECT
*
FROM
ds.test1
Please note that the current version of the structure checking algorithm detects only the first occurrence of structure mismatch. This means that if a query gets data from more than one modified table, the error message will include information only about the first of them. Information about the next issue will be shown only after the previous one has been fixed.
PLAINID_CONFIGURATION
このオプションは、PlainID認可ポリシーを有効にします。PlainID側でサービスがどのように設定されているかによって、いくつかのパラメータを入力として受け取ります。以下のパラメータが使用できます:
Parameter | Description |
---|---|
| URL of the PlainID endpoint |
|
|
|
|
|
|
| Expression used for column masking. It can be a simple string or a more complex expression (see our column masking documentation) |
| Can be |
Example
CALL SYSADMIN.setDefaultOptionValue(
"opt"
=>
'PLAINID_CONFIGURATION'
,
"val"
=>
'url=http://123.123.123.123/plainid-accesslist/resolution,appId=XXX,appSecret=YYY,entityType=DV_Users,mask="00000",userswithdomain=false'
) ;;
Note
Please note that resource names should be fully qualified in PlainID and they should exactly match the names of the resources defined in CData Virtuality.