KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Creating Composite Indexes
PRODUCT: 4D Developer | VERSION: 11 | PLATFORM: Mac & Win
Published On: September 10, 2008

One of the new types of indexes featured in 4D v11 SQL is the Composite Index. Composite Indexes are optimized for queries on two fields. They make the need for composite fields obsolete. In previous versions of 4D developers sometimes created a new field and combined all the data from separate fields into the new field. Then they indexed the new field so as to simulate a Composite Index. The new Composite Indexes run faster than the old workaround that was used and do not require the creation of a new field to store repetitive data.

Composite fields are not created in the regular manner. There are two ways to create a Composite Index:

One is via the Structure Editor:
-Select multiple fields in the Structure Editor
-Right click (on Windows) or control+click (on Mac) and select "New Composite Index..." from the menu

Another way is to use the Index List User Interface:
-access the UI from the Structure Editor via the key icon as shown in the following screen shot:



All types of indexes can be added, deleted, and edited within the Index List.