Open topic with navigation

# Indexes

If your connector frequently uses filters based on the value of one column, you can significantly increase the speed of queries by creating an index. To create an index for the Reference column of a table, use the following code:

           docs.CreateIndex(new string[] { "Reference" });

After the index has been created it is maintained automatically, and used automatically by any filters that filter on the relevant column. Calling `CreateIndex` when an index already exists is harmless, so typically it is called immediately after `NewTable`, regardless of whether the table had to be created or already existed. Although it is not necessary to create an index, doing so can significantly improve performance, at the cost of a larger datastore file.

If the connector frequently uses a filter involving multiple columns, you can create a multi-column index. For example, if you expect to frequently use a filter for items that have a particular reference and were modified on a particular date you could use the following code:

           docs.CreateIndex(new string[]
            	{ "Reference", "LastModified" });

Note that this does not create an index for filtering by the Reference column and an index for filtering by the LastModified column, but an index for filtering by both columns together.

You can use repeated calls to ``CreateIndex`` to make as many indexes as you like, though each index will increase the size of the datastore file. Filters can be used without an index, but will be slower.

NOTE:

If a unique constraint is specified for a set of columns, an index for those columns is created automatically, so it is not necessary to call `CreateIndex` as well.

© 2018 Micro Focus or one of its affiliates | Send documentation feedback to Micro Focus Close Send documentation feedback To open the configured email client on this computer, open an email window. Otherwise, copy the information below to a web mail client, and send this email to swpdl.idoldocsfeedback@microfocus.com. We appreciate your feedback! Product: Topic Title: Help Topic: Feedback:

_FT_HTML5_bannerTitle.htm