When the AFAttributeSearch(AFDatabase, String, String) AF SDK method is used, the AF Server will produce queries that may result into suboptimal SQL Server execution plans when using the default pageSize parameter for searching including attribute name and description.
As an example, poor performance maybe exhibited when searching for attributes in PI Vision where the AF database may contain a large number of excluded attributes, which could be the case for AF databases created from a PI Connector.
An implementation where better/new table statistics/indexes, restructuring of the SQL queries generated by the AF Server, or actively considering the pageSize to determine more optimal plans could make searches more performant.