Add a partition index to this table.
Namespace: NetricsServerInterface
Assembly: NetricsServerInterface (in NetricsServerInterface.dll)
Syntax
Visual Basic (Declaration) |
---|
Public Sub addPIndex( _ ByVal field_name As String, _ ByVal primary As Boolean, _ ByVal partition_separators As String(), _ ByVal normalized As Boolean _ ) |
C# |
---|
public void addPIndex( string field_name, bool primary, string[] partition_separators, bool normalized ) |
C++ |
---|
public: void addPIndex( String field_name, bool primary, array<String>^ partition_separators, bool normalized ) sealed |
J# |
---|
public void addPIndex( string field_name, bool primary, string[] partition_separators, bool normalized ) |
JScript |
---|
public
function addPIndex( field_name : String, primary : bool, partition_separators : String[], normalized : bool ) |
Parameters
- field_name
- The name of the field that is to be indexed.
- primary
- If true this is a primary index, otherwise it is a secondary index. Primary indexes give a much better performance improvement, especially on large tables and with highly selective predicates, but at a cost of significantly larger memory requirements and slightly slower load times. The additional memory overhead for a primary index is much larger if more than one primary index is defined for a table. For joined tables, a parent table can have at most one primary index. Although a child table can have one or more primary indexes, the first such index incurs a very large memory overhead. A joined search cannot use a primary index on a child table, only a non-joined search can use such index.
- partition_separators
- This is an array that defines the upper bound of each partition. The values MUST be in sorted order (as per the type of the named field) smallest to largest. E.g. for a text field the separators might be all single letters and symbols that the field value can begin with; for a date field they might be dates representing the start of each year, etc. The maximum number of partitions is 1026. As there are two predefined partitions for empty and invalid values and a final partition for values greater than the last separator this limits the total number of separators to 1023.
- normalized
- If true and the field is a string value the normalized values are indexed. Thus this index will work with the case insensitive comparison operators and not work with the standard operators.
Remarks
This method is used to add a partition index to the table. These indexes can be used to speed the processing of Filtering Predicates. A partition index groups records in the table into a set of partitions based on the value of the named field. The number of partitions and range of values that are placed in each partition must be defined when the index is created. These are defined by the partition_separators parameter.
If you are using filtering predicates, properly defined partition indexes in conjunction with a properly formulated predicate expression can dramatically improve performance on large tables. Consult your ibi support representative to determine the optimal use of partition indexes for your situation.