In this case, the bottleneck is not page contention. Adopting Insert Algorithm 2 in such a scenario did not cause any performance difference. This measurement was run by using a PBR table that was defined with PAGE LEVEL LOCKING and COMPRESS YES with one index in a two-way data sharing environment. 

The workload consists of 180 insert threads and 120 delete threads. These threads ran concurrently on both data sharing members. The first measurement was run with Db2 12 that used Insert Algorithm 1 and the second measurement used Insert Algorithm 2. 

In this scenario, almost no difference was observed in the insert rate and CPU consumption between both insert algorithms. 

## 2.3.4 Insert Algorithm 2 usage considerations 

How much benefit can be realized from the use of Insert Algorithm 2 varies depending on the workload’s specific characteristics. Generally, workloads that are constrained by lock/latch contentions on the space map pages and data pages are likely to benefit more from the new insert algorithm. 

Also, by solving the space search bottleneck when Insert Algorithm 2 is used, bottlenecks can occur in other areas that are exposed by the faster inserts. It is possible for the throughput bottleneck to shift to the following areas: 

GLYPH<SM590000> Index leaf page latch contention. 

GLYPH<SM590000> Log write I/O performance. 

GLYPH<SM590000> Format write during data set extending. 

GLYPH<SM590000> BP/GBP size is not large enough. With the increased throughput of the use of Insert Algorithm 2, you might need to increase the size of the local or group buffer pool to use the system to its full potential. 

Index insert speed is also vital for insert transactions. When index inserts are slow, the benefit the insert operations get from the new insert algorithm for the data pages can become less evident. 

Insert Algorithm 2 is disabled internally at the partition level if lock escalations or LOCK TABLE statement being used. A new message DSNI055I is issued if Insert Algorithm 2 cannot be used for the partition. In this case, Db2 switches back to the old insert algorithm. The DSNI055I message uses the following format: 

DSNI055I INSERT ALGORITHM 2 HAS BEEN DISABLED FOR THIS PARTITION. DBID=dbid PSID =psid PARTITION=partition-number REASON=reason-code LOCAL TIME OF ERROR=local-timestamp REASON FOR ERROR=error-reason-code TRACE=internal-trace-information 

At the time of this writing, a stop and start of the table space partition is needed to allow Db2 to re-enable Insert Algorithm 2 for that partition after DSNI055I was issued for it. 

To support Insert Algorithm 2, more real storage is required to store the pipe information. If not enough real memory is available to back the extra storage that is needed, Insert Algorithm 2 is not be enabled. Customers who want to use this new feature must plan for the extra real storage usage and might also need to adjust the local buffer pool and group buffer pool size for the qualifying table space partitions and the Db2 members. 

To monitor the use of Insert Algorithm 2, several enhancements were made to the Db2 instrumentation component. For more information, see “Insert Algorithm 2 IFCID changes” on page 350 for more details. 

