Is there any way to force DB2 optimization(Query optimization) Using the expression like (0<>0). I can see this expression in embedded SQL statements in PL1 program.
(FIELD = 'VALUE' OR 0 <> 0)
DBA suggests that this expression force DB2 optimizer and removing the expression will be useful to use Indexes. Is there any documentation regarding this. I don't see documentation of using an expression to specify db2 optimizer/Query Optimization usage.
DB2 server platform: Linux DB2 version: 11.5.7.0
I strongly recommend not to use such additional predicates. Nobody will know when and why these had been added anf if they are still valid or meanwhile contra productive.
There are "official" ways to make the optimizer move to better decisions and a more performant access path. I suggest you have a look at following topics (in this order):