When Indexes Work: Optimizing Sql Queries For Low-Code Applications
Low-code tools are soaring in popularity because they let users quickly create applications without coding. Oracle Application Express (APEX) is a leading low-code platform that runs within the Oracle Cloud, making it convenient and easy to use. Business users can create database-driven interactive dashboards with forms, reports, and graphs, in less than an hour without writing a single line of code. However, the SQL queries that APEX generates are not optimized for performance, many APEX users lack the skills to optimize them using the Oracle tuning tool, and there is little guidance on when indexes are efficient in APEX applications. This study investigates which query types benefit from indexing within APEX dashboards, and which query types do not benefit from indexes. The dashboard that was evaluated employed common types of auto-generated APEX queries. Query baseline performance was captured using debug mode, and the execution plans analyzed. B-tree indexes drastically improved filtered query performance by over 87% in execution cost and almost 36% in query time. However, B-tree indexes provided no benefit for aggregation queries that process all rows in the table. Surprisingly, composite indexes actually degraded performance by 228%, increasing execution costs substantially. These findings show indexes are not a silver bullet. This research offers practical guidance for APEX developers on how to optimize their queries effectively. The results demonstrate that developers should use indexes strategically, based on the type of query, rather than blindly assuming that all indexes boost performance.
