Difference between optimization and tuning
Optimization is a compiler-driven process without significantly affecting development time that looks for chances to rearrange your source code and improve the overall performance of your program. While Without significantly affecting development time, optimization is a compiler-driven technique that looks for chances to rearrange your source code and improve the overall performance of your program. You can use optimization and tweaking alone or in tandem to boost your application’s performance.
The first step in understanding how the various levels, settings, and strategies might improve performance is understanding how they vary from one another. The XL compiler optimization suite already works best with well-written source code through a thorough debugging and testing procedure. You control it using compiler options and directives.
The following advantages may result from these optimization changes: Reduce the number of instructions your program needs to execute to complete essential tasks. Boost the use of the memory subsystem. Utilize the architecture’s capacity to manage high levels of concurrent shared-memory processing. While tuning allows you to modify certain features or target real-time control of your program to increase performance, optimization performs generic modifications intended to enhance the performance of any application in any supported environment. Tuning for your application and target architecture might improve performance at low optimization levels. The compiler can achieve the following gains with correct tuning: Choose more effective machine instructions.
Create a series of instructions that is better appropriate for your application. Choose from a variety of more targeted optimizations to enhance your code. Simply said, optimizing refers to the actions the optimizer takes about the execution plan. Programmers tune programs using the source code. As Celko mentioned, the Optimizer optimized the query so that it runs as quickly and efficiently as possible given the known DB statistics.
The term “tuning” is a general one that refers to improving the performance of a query. There are many ways to do this, including starting over with a new query, refactoring the query code to perform the same logic more quickly, or simply redesigning the database’s indexes, which typically involves adding or removing indexes to improve the query’s performance without altering the query itself.