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, and SQL optimization tools such as IBM® Data Studio or IBM Data Server Manager, to analyze the access paths for your SQL statements, see the following topics:
- Investigating access path problems
- 00C200A4
- Investigating SQL performance by using EXPLAIN
- Interpreting data access by using EXPLAIN
- EXPLAIN tables
- EXPLAIN
- Tuning SQL with Optim Query Tuner, Part 1: Understanding access paths (IBM developerWorks)
- Generating visual representations of access plans (IBM Data Studio)
- 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: