Improve Object Query Performance

Investigate and optimize object query performance for Native Object API applications on iOS, Windows Mobile, BlackBerry, and Android platforms.

While most simple queries run with reasonable performance, complex queries require a good understanding of the underlying database schema derived from the MBO data model, as is the case in a client/server computing environment where the DBA is often consulted to develop optimized stored procedures or perform database tuning. The differences with mobile application development are that:

The Query API is used on Windows Mobile, BlackBerry, and Android platforms, while SUPQuery is used by iOS. Mobile application developers can use these APIs to query the on device database and return data in the form of a result set.

The SQL statement is generated based on the Query/SUPQuery object constructed by the application and allows the Object API to inject conditions to deal with the object states necessary for offline computing. When an object is modified, there is a pending state (current), a download state (server), and the original state (before first modification). The pending and download states reside in the MBO table. The extra conditions in the SQL statement enable the return of either the pending state (if there is one) or the download state. No query optimization is performed by the Object API during the generation of the SQL statement. See either Query and Related Classes or SUPQuery and Related Classes in the Developer Guide: yourPlatform Object API Applications.