# Sortable Implementation
The logic that defines the sortable feature is wired into the core engine. The sortable feature is activated by setting the sortable flag for a CEId field.
# Rank Field
For each sortable field the system creates a rank field in the same table as the sortable field. This field stores a rank value that represents the order of the rows with respect to the sortable field.
If the sortable field is in the module table, the rank field is also placed in the module table. The
rank field is then named after the sortable field extended by the suffix _rank. If the sortable
field is placed in an external table the rank field is placed in the same external table and is
simply named rank
.
Placing the rank and the sortable field in the same table allows to create a database index over
both fields. This index is considered necessary because order by
queries referring to both fields
are expected be performed frequently.