Purpose

GeneXus automatically creates indices that efficiently access Tables and permits a more efficient Integrity Control.
There are three types of indices: Primary, Foreign and User.

Primary Index: The primary index defines the primary key and it is used to control record uniqueness. It also controls, when records are created in the subordinated table, that the corresponding record exists in the superodinated table. GeneXus automatically defines all primary indices from transaction identifiers.
 
Foreign Index: Foreign Indices are used to make more efficient inter-table integrity controls. They are also automatically defined. When a record is removed from the subordinated table, there should be no corresponding record in the subordinated table.
 
User Index: User Indices are mainly defined to search through data in an efficient way. For example, in Client table you can define an index using the client's name, which is very useful when generating reports ordered by Client name. User-defined indices are not automatically defined because they are not used for integrity controls.

Airline table indexes example

In a relational database, indices are used for performance reasons, but it is always possible to access table data using any of its attributes. This is always true because it is possible to order a table based on any of its attributes whenever necessary. For example, by either creating a temporary index or by using the resources provided by the database we use.



Subcribe to this category's changes
Sub CategoriesAdd a new subcategory in this category
PagesAdd a new page in this category