Scope: managed applications, mobile applications, and ordinary applications.
1.1. Composite type attributes used in join conditions, filters, and for ordering must contain only reference attribute types (CatalogRef.[…], DocumentRef.[…], and other). Do not include any other non-reference types in this type. For example: String, Number, Date, UUID, Boolean, and ValueStorage.
Otherwise, query performance is significantly reduced because of the way composite type attributes are stored in DBMS table columns. See Specifics of storing composite data types.
For example, a document contains a composite type attribute Address that includes a reference to the Contacts catalog and a "string" to enter arbitrary values. Instead, provide a separate ArbitraryAddresses catalog and specify it in the Address attribute instead of the string. Ensure that new items are added automatically to the ArbitraryAddresses catalog upon writing documents. To delete unnecessary items of the ArbitraryAddresses catalog, use a scheduled job.
Exceptions are universal algorithms used for arbitrary reference objects.
2.2. If a composite type is widely used in subsystem objects or in the application, use user-defined types.