Add Rules and Indices to Tables
Rules and indices are added to tables to clean data (rules) and improve performance (indices) in the target system.
The rule and index administration includes the following topics:
Register Rules to Tables
Rules are registered to a Target Source to change or customize the Target Source tables. Create new rules using the following naming convention: [Database].[dbo].[RulePrefix][TableName]_[FieldName]_[Description][Action], where
-
[Database] is the database name. This is required in front of each rule name; otherwise, the rule points to the target database, e.g., dgSAP.dbo.irMyRuleIsIndgSapDatabase.
-
[dbo] is the schema owner
-
[RulePrefix] is the Action Filter stored in the Common > Configuration > Modules > Parameters-Collect
-
[TableName] is the name of the table impacted by the rule.
-
[FieldName] is the name of the field within TableName impacted by the rule.
-
**[Description]**is a brief description of the rule’s function.
-
[Action] is Update (Upd), Insert (Ins) or Delete (Del).
Register the rule after data has been downloaded by the package.
NOTE: Collect rules require database and a schema owner prefix for the rule to process correctly.
To register a rule to a table:
-
Click Targets in Navigation pane.
-
Click Sources for Target.
-
Click Tables for Source.
-
Click Rules for Table.
-
Click Add.
-
Enter order in which rule runs in PRIORITY field.
-
Enter a rule name in RULE field.
-
Update RULE TYPE list box if the default value is not applicable. Values are:
-
Rule – Performed after the data has been downloaded by the package
-
Action – Generic and performed at the field level, where rules are customized and can be performed against an entire table or single column
-
-
Update PRECEDENCE list box if the default value is not applicable. This field controls the execution order of the rule or action. Values are:
- After – Rule runs after table is downloaded
- Before – Rule runs before table is downloaded
-
Select a name from FIELD NAME list box to control the field impacted by action.
-
Click ADD TARGET DB PARAM check box to enable it, adding a database parameter when running the rule
NOTE: Activating the ADD TARGET DB PARAM field is helpful when rules are stored in the Collect database and run in another database – users are able to clearly see the originating database.
-
Enter a value in WHERE CLAUSE field to limit rule to run on only part of the table data.
-
Click Save.
-
Click Vertical View.
-
Click Edit.
View the field descriptions for the Table (Rule) page’s Vertical View
-
Enter notes about rule in Comment field.
-
Enter client specifications for a custom rule in Spec ID field.
-
Click Save.
Create Indices for Tables
Indices built during the Create Package process are registered to a Target Source to improve performance. For the download process to perform better for large tables, drop and build the indices and/or the primary key.
Collect has the ability to build indices and primary keys for the target tables. Indices and primary keys are built with general SQL statements without considering space allocation or clustering. To use these features, create a customized rule containing the required SQL view and run it after a data download. For large tables, it is recommended to drop the index before downloading the data and to recreate the index after the data has been reloaded.
NOTE: Collect builds SAP Primary Keys during the Build Package process. Primary keys for source systems are automatically created if Download Indices Keys is enabled for the source. To build keys and indices for non-SAP sources, verify the Download Keys Indexes check box on the Target Sources page’s Vertical View is enabled.
To build indices or primary keys for SAP:
-
Click Targets in Navigation pane.
-
Click Sources for Target.
-
Click Tables for Source.
-
Click Indices for Table.
-
Click Add.
-
Enter a name in INDEX ID field.
-
Click UNIQUE INDEX check box to build a unique index.
OR
Click PRIMARY KEY check box to build the index as a primary key for the tables.
-
Click CLUSTERED INDEX check box to mark the index as clustered.
NOTE: CLUSTERED INDEX can be used with PRIMARY KEY to create a clustered or non-clustered primary key.
-
Click Save.
-
Click Columns for Indices.
-
Click Add.
View the field descriptions for the Target Source Table Index Columns page
-
Select a value from COLUMN list box to indicate the table column impacted by the index.
-
Update COLUMN ORDER field if the default value is not applicable.
NOTE: The COLUMN ORDER field controls the sort order of the column.
-
Click Save.
-
Click Back button on Browser to return to Table (Indices) page.
-
Click Build Indices icon to schedule the rebuild process for all index in Target Source Table index; a confirmation message displays.
NOTE: Only indices and keys registered to the table are rebuilt.
-
Click Ok.
NOTE: Indices are built in the background and may take several minutes.
Drop and Recreate an Index
In order to fine tune performance of an index, the index must be dropped and recreated.
To recreate an index:
- Click Targets in Navigation pane.
- Click Sources for Target.
- Click Tables for Source.
- Click Indices for Table.
- Select Indices to rebuild.
- Click Build Indices icon on Page toolbar to schedule the rebuild process for all index in Target Source Table index; a confirmation message displays.
NOTE: Only registered indices and keys are rebuilt. Indices are built in the background and may take several minutes.
Was this article helpful?
Sorry about that.
Why wasn't this helpful? (check all that apply)
Thanks for your feedback.
Want to tell us more?
Send an email to our authors to leave your feedback.
Great!
Thanks for your feedback.