Block join execution
- Last Updated: May 12, 2026
- 2 minute read
- OpenAccess SDK
- Version 8.1
- Documentation
This section describes how block join execution works when inner tables are queried for join columns when they are indexed and when they are not indexed.
Join columns are indexed
SELECT ... FROM emp, dept WHERE emp.deptno = dept.deptno
Assume that the join order for the processing is emp, dept and dept has an index on deptno column.
- The OpenAccess SDK SQL engine first queries for
emptable records. - For each block of
depttable records from the result of step 1, OpenAccess SDK queries thedepttable and passes the search condition ondeptnoasdeptno in(1, 2, 5). The IP uses indexed file access to return the matchingdeptrecords. - The OpenAccess SDK SQL engine combines the results of Steps 1 and 2 to prepare the final result.
Join columns are not indexed
SELECT ... FROM emp, dept WHERE emp.deptno = dept.deptno
Assume that the join order for processing is emp, dept and that the dept table’s deptno column is not indexed.
- The OpenAccess SDK SQL engine first queries for
emptable records. - For each block of
emptable records from the result of Step1, OpenAccess SDK SQL engine queries the dept table. The IP does a full table scan and returns all records in dept. OpenAccess SDK SQL engine filters these by applying the condition ondeptno(deptno IN(1,2,5)). - In Step 2, the IP can indicate to the OpenAccess SDK SQL engine that it is doing a full table scan. The OpenAccess SDK SQL engine caches the results to be used for the entire join processing. No further queries on
depttable is sent to the IP. - When the IP is returning full table scan results of
depttable, if it exceeds the configurable limit of MAX_TABLE_ROWSET_SIZE, the OpenAccess SDK SQL engine does not cache the rowset records; it only retains the records applicable for the current outer table block join rows. For the next set of outer table rows, the OpenAccess SDK SQL engine uses Step 2 to query the IP again.
If the inner table is being processed without search conditions, the OpenAccess SDK SQL engine checks the inner row to match the join condition with at least one of the outer table rows before adding them to BlockJoinRowset. This minimizes the BlockJoinRowset size.