INTELLIGENT ANALYSIS OF PERFORMANCE RESULTS BASED ON OBJECT-RELATIONAL MAPPING STRATEGIES AND FOREIGN KEY CONSTRAINTS IN SQL DATABASES
Oleksandra Ryba�k, Oleh Husak, Roman Mysiuk · Electronics and Information Technologies · 2026
Background . The rapid expansion of data-driven applications has increased the importance of efficient query execution in relational database systems, where even minor inefficiencies can significantly affect overall performance. Although Object-Relational Mapping (ORM) frameworks simplify development and improve maintainability, their abstraction layer can introduce measurable overhead, and the impact of foreign key constraints on execution speed remains a practical concern, particularly in microservice architectures that follow the “Database per Service” principle. Materials and Methods. An experimental information system is developed using a relational database and the SQLAlchemy ORM framework, with a schema that includes one-to-one, one-to-many, and many-to-many relationships tested both with and without foreign key constraints. Three representative queries retrieving booking details, aggregating related records, and calculating total payments are executed using raw SQL and ORM approaches, while an intelligent algorithm analyzed performance, detected potential N +1 query risks, and recommended optimal strategies such as explicit JOINs. Results and Discussion. Raw SQL consistently demonstrated superior performance across all scenarios. The most significant disparity occurred in ORM implementations affected by the N +1 problem, where execution time exceeded that of equivalent SQL queries by more than an order of magnitude. Aggregation queries showed smaller yet consistent overhead. The presence or absence of foreign key constraints had a negligible influence on raw SQL performance, with differences remaining within experimental variance. Explicit JOIN usage in ORM substantially reduced overhead compared to implicit relationship navigation. The intelligent analysis accurately predicted high-risk queries and provided effective strategy recommendations, confirmed by empirical results. Conclusion. ORM frameworks improve productivity and maintainability but introduce measurable overhead. Raw SQL remains preferable for performance-critical tasks, while foreign key constraints do not significantly degrade execution speed. Intelligent performance analysis supports balanced decisions between efficiency and maintainability in complex relational systems. Keywords : relational databases, SQL performance, ORM, decision support system, intelligent analysis, database design