Index Repository (Magic xpa 4.x)
The Index repository lets you define unique or non-unique index entries to browse through a designated table. Index entries are associated to Index segments, such as an ID number, email address or telephone number for a specific table.
You access the Index repository by clicking on the Indexes tab at the bottom part of the Data repository.
The definition of the index is logical and relevant only to Magic xpa. The index in the database may differ from the index defined in Magic xpa. By using the Get Definition utility, you can access the actual index structure in the database.
Note: The maximum number of indexes for each data source is different for each DBMS.
The developer wants to build an index in Magic xpa that matches the index in the database so that no Sort operation is required by the Optimizer. The more aligned the indexes are between Magic xpa and the selected database, the faster the response time.
When defining an index in Magic xpa the following results occur:
-
If you assign a real index type to a new table, Magic xpa creates an index in the database to match the Magic xpa index.
-
In runtime, the Magic xpa index determines how the ORDER BY clause is added to the SELECT statement issued by Magic xpa. The segments specified in the index are the columns that are specified in the ORDER BY clause.
The Index repository includes the following columns:
|
|
#
|
This read-only column contains an automatically generated sequential number used by Magic xpa as an index identifier.
|
Name
|
A descriptive name for the index. The name can contain upper and lowercase letters, numbers and spaces. The maximum length for an index name is 31 characters.
The actual name of the index is set in the DB Index Name property.
|
Type
|
Select either Unique or Non-Unique from the Type box.
Unique (default) – When setting a unique index, only one row with a specific value in the index can be present in the table. Some SQL gateways require at least one unique index in Magic xpa to work with a table.
Non-unique – When setting a non-unique index, duplicate index rows are allowed.
|
Primary Key
|
This check box specifies which index is the Primary Key. Only one of the unique indexes can be the Primary Key.
|
Index Segments
Index Properties
SQL Considerations