OPTOFC (optimize-OPEN-FETCH-CLOSE) is a JDBC option in GBASE's GBase 8s that reduces network round trips when executing SELECT statements with PreparedStatement . This post explains how it works and demonstrates the real performance gain with benchmarks.
When OPTOFC Takes Effect
The optimization kicks in only when all of the following are true:
The statement is a PreparedStatement instance.
The query is a SELECT .
The ResultSet type is TYPE_FORWARD_ONLY .
The concurrency mode is CONCUR_READ_ONLY .
What It Does
Merges OPEN and FETCH messages — Normally these are two separate network requests. With OPTOFC , they are sent together, saving one round trip. (Without variable‑length columns the driver may already merge them; with variable‑length columns you must enable OPTOFC=1 to force the merge.)
Auto‑closes the cursor — If all rows are fetched from the server, the server closes the cursor automatically.…