OPTIMIZE FOR N ROWS gives the optimizer a hint as to the cardinality of the result, as well as determining the block size for communication between client and the db2 server.
Originally Posted by ApoPen
Use it whenever you know how many rows will be returned, as long as you don't mind going through and updating it when things changed.
Don't get it wrong, though, since if more rows are returned there could be a negative impact on communications (more back-and-forth to retreive the result set) and on query optimization.
DB2 Database Consultant