Menu

Post image 1
Post image 2
1 / 2
0

Optimizing GBase 8s JDBC with the OPTOFC Parameter

DEV Community·Michael·29 days ago
#nXHjoCd0
Reading 0:00
15s threshold

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. The subsequent ResultSet.close() call then avoids an extra network request.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More