Programming applications for performance
You can achieve better Db2 performance by considering performance as you program and deploy your applications.
Procedure
To improve the performance of application programs that access data in Db2, use the following approaches when writing and preparing your programs:
- Program your applications for concurrency. The goal is to program and prepare applications in a way that:
- Protects the integrity of the data that is being read or updated from being changed by other applications.
- Minimizes the length of time that other access to the data is prevented.
For more information about data concurrency in Db2 and recommendations for improving concurrency in your application programs, see the following topics: - Write SQL statements that access data efficiently.
The predicates, subqueries, and other structures in SQL statements affect the access paths that Db2 uses to access the data.For information about how to write SQL statements that access data efficiently, see the following topics:
- Use EXPLAIN or SQL optimization tools to analyze the access
paths that Db2 chooses to process
your SQL statements. By analyzing the access path that Db2 uses to access the data for an SQL statement, you can discover potential problems. You can use this information to modify your statement to perform better.For information about how you can use EXPLAIN tables to analyze the access paths for your SQL statements, see the following topics:
- Consider performance in the design of applications that
access distributed data. The goal is to reduce the amount of network traffic that is required to access the distributed data, and to manage the use of system resources such as distributed database access threads and connections.For information about improving the performance of applications that access distributed data, see the following topics:
- Use stored procedures to improve performance, and consider
performance when creating stored procedures. For information about stored procedures and Db2 performance, see the following topics: