resources

Check Exadata Smart Scan Offload in Oracle 19c

To check whether an Oracle Database 19c query used Exadata Smart Scan, inspect the cached execution plan and compare storage offload counters for the same child cursor before and after a known execution. A storage predicate shows what the plan can push to the cells. An increase in filtered bytes returned by the cells is runtime evidence of offload.

Before you start

This read-only procedure covers Oracle Database 19c Enterprise Edition in a PDB on an on-premises Oracle Exadata Database Machine. Connect to the workload’s PDB service and gather both readings on the same database instance. If you need a client, see how to install Instant Client and SQL*Plus. For the roles of database and storage servers, see the Exadata architecture overview.

Use an approved DBA account with permission to execute DBMS_XPLAN and SELECT or READ access to V$SQL, V$SQL_PLAN, V$SESSION, and V$SQL_PLAN_STATISTICS_ALL, as described in Oracle’s 19c DBMS_XPLAN reference. The 19c licensing guide lists support for Exadata Storage Server Software under Enterprise Edition on Exadata (EE-ES). Verify entitlement for your deployment; this procedure does not use AWR, ASH, or Real-Time SQL Monitoring.

These SQL examples are untested. Use a known, already cached statement and an approved observation window. Do not rerun an expensive production query solely to collect a sample.

1. Identify the child cursor and record a baseline

Replace <sql_id> with the SQL ID from your workload. Record the child number, plan hash, and counters for the row you intend to observe. If several children appear, confirm which one the workload uses before comparing readings.

SELECT con_id, child_number, plan_hash_value, executions,
       io_cell_offload_eligible_bytes,
       io_cell_offload_returned_bytes,
       io_interconnect_bytes
FROM   v$sql
WHERE  sql_id = '<sql_id>'
ORDER  BY child_number;

The 19c V$SQL reference defines eligible bytes as I/O bytes the storage system can filter. Returned bytes count filtered bytes the cells sent back after offload. Interconnect bytes measure I/O exchanged between database and storage, so that column is not interchangeable with filtered bytes returned.

2. Inspect the cached plan

Replace <child_number> with the numeric child number from step 1. Look in the Predicate Information section for storage(...) attached to a scan. Treat it as a plan clue; use the counters in the next step for runtime evidence. Oracle documents how storage predicates can be displayed for eligible expressions, including in an explained plan before migration to Exadata.

SELECT *
FROM TABLE(DBMS_XPLAN.DISPLAY_CURSOR(
  '<sql_id>', <child_number>, 'TYPICAL PREDICATE'));

3. Compare the counters after execution

After an observed execution completes, repeat step 1 and subtract the baseline from the new values for the same child cursor. If other sessions used that cursor during the interval, the deltas describe the shared interval, not a single execution. Discard the comparison if the cursor changed or the counters reset.

  • An increase in returned bytes shows that the cells returned filtered results during the interval.
  • An increase in eligible bytes alone does not show how much data was filtered. Zero returned bytes is inconclusive on its own; an offloaded predicate may find no matching rows.
  • Keep interconnect bytes separate. Do not use their difference from eligible bytes as an exact percentage of rows filtered or as a measure of query speedup.

If the plan or counters do not match your expectations

If no row or cached plan appears, check the PDB, instance, SQL ID, and child number before concluding that offload did not occur. If the cursor is no longer cached, arrange another approved observation rather than comparing it with a different child.

If the cursor is present but shows no useful offload evidence, check the access path. The Exadata Smart Scan guide describes full table scans and fast full index scans that use direct path reads. An index lookup is not the same access path. Ask the DBA whether CELL_OFFLOAD_PROCESSING is disabled for the workload; do not change it to obtain a result from this check.

For the background behind the counters in this guide, see the chapter on offloading and Smart Scan in Expert Oracle Exadata. The book covers earlier Exadata generations, so use the 19c documentation and your own execution statistics for release-specific behavior.

Cover of Expert Oracle Exadata, 2nd Edition

Expert Oracle Exadata, 2nd Edition
Apress, print edition
View on Amazon (paid link)