← Blog archive

AIDP · ADW

Where Should the Processing Run? Performance Engineering in Oracle AI Data Platform

Where should AIDP processing run? A practical guide to Spark, Object Storage and Autonomous AI Lakehouse, from workload placement to indexing and caching.

Performance engineering across Spark, Object Storage and Autonomous AI Lakehouse

Performance problems in a modern data platform rarely belong to one component. A slow pipeline may appear to be a Spark problem, yet the real cause might be millions of small files in Object Storage. A database query may appear to need more compute, while the underlying issue is stale statistics, an unsuitable data layout or a transformation that should have taken place before the data reached the database.

Oracle AI Data Platform brings together several different execution and storage capabilities. That flexibility is valuable, but it also creates an architectural choice: should a particular operation run in Spark or in the Oracle Database engine, and should its data remain in OCI Object Storage or be loaded into Autonomous AI Lakehouse? Object Storage is the storage layer; Spark and the database provide the execution engines.

AIDP performance is achieved by placing each workload in the right execution engine, arranging the data for that engine and scaling compute only after the design has been validated.

This article focuses on data engineering and analytical workloads, rather than AI agent inference. It examines that decision across the complete processing path. It covers AIDP compute clusters, Spark optimisation, Object Storage layout, Autonomous AI Lakehouse tuning, automatic indexing, automatic partitioning and the point at which data should move from lake processing into database processing.

Performance starts with the workload

Before changing cluster sizes or database compute, it is worth defining what the workload is actually trying to achieve. Two jobs that process the same volume of data can have very different performance characteristics. A scan and filter across independent files is naturally parallel. A large join on a highly skewed key may spend most of its time moving data between workers. A selective query returning a few thousand rows from a relational model may be better served by the database than by starting a distributed Spark job.

The initial assessment should consider:

  • The total data volume and the volume changed during each run.
  • Whether the workload is batch, streaming, interactive or serving concurrent users.
  • The structure of the data, including structured, semi-structured and unstructured content.
  • The complexity of the transformation and whether it depends on procedural code or specialist libraries.
  • Where the source data currently resides and where the result will be consumed.
  • How frequently the same result will be queried or reused.
  • The required latency, recovery behaviour and cost envelope.

These questions expose an important distinction. Performance is not only about how quickly an engine can perform a calculation. It also includes the time and cost required to start compute, read the data, move it across service boundaries, write intermediate results and make the output available to downstream consumers.

Spark or Autonomous AI Lakehouse?

Spark and the Oracle Database engine overlap in several areas. Both can filter, join, aggregate and transform large datasets. Spark SQL also executes SQL, so the choice is about the execution engine, not simply Python versus SQL. The architectural decision is therefore not based on whether an operation is possible. It is based on which engine is naturally suited to the workload and where the data already resides.

Workload characteristic Spark is generally better suited Autonomous AI Lakehouse is generally better suited
Raw data Large collections of files, mixed formats and evolving structures Controlled loading of structured data
Transformation Complex distributed processing, custom code and specialist libraries Set-based relational transformations expressed efficiently in SQL
Incremental change Distributed changes to transactional lake tables, where the table format and integration support them Database-resident MERGE, updates, transactional consistency and repeatable ELT
Analytics Exploration, feature engineering and distributed preparation Reusable joins, aggregations, dimensional models and concurrent BI
Consumption Outputs retained in open lake formats for multiple engines Curated data repeatedly served through SQL with predictable response times

Table 1. A workload-placement guide rather than an absolute rule. Data locality and downstream consumption can override the generic preference.

Practical rule of thumb: Use Spark to reshape large, raw or complex datasets. Use Autonomous AI Lakehouse to manage, join, aggregate and serve structured data repeatedly.

There are exceptions. If a large relational dataset already resides in Autonomous AI Lakehouse, exporting it to Object Storage solely to perform a straightforward aggregation in Spark is unlikely to be efficient. Conversely, repeatedly pulling bulk data from a database into Spark can create an avoidable transfer bottleneck. Oracle’s Data Flow performance guidance recommends Object Storage and Parquet for bulk Spark processing. Those general Spark principles are useful here, but Data Flow settings and service limits should not be assumed to apply to AIDP.

The hidden cost of crossing execution boundaries

A common lakehouse pipeline moves through several stages: a source extract is written to Object Storage, Spark transforms the files, curated data is written back to the lake, and selected datasets are then loaded into Autonomous AI Lakehouse for serving. Each transition may be justified, but every transition also introduces serialisation, network transfer, orchestration and another possible failure point.

The design review should therefore ask:

  • Is Spark repeatedly reading a large database table across JDBC?
  • Is an intermediate write to Object Storage justified by replay, audit or reuse requirements, or is it an avoidable extra step?
  • Is the same dataset being copied or serialised several times?
  • Could the transformation run as ELT after the data is loaded?
  • Could an external table avoid a copy for infrequently accessed data?
  • Would frequently queried external data perform more predictably if it were loaded or cached?

The best engine in isolation may not produce the fastest end-to-end pipeline. Moving hundreds of gigabytes to reach that engine can cost more than the proposed optimisation saves.

Right-sizing AIDP compute clusters

AIDP all-purpose compute clusters provide the Spark execution environment for notebooks and workflows. The Quickstart configuration is useful for getting started, but it should not be treated as a production sizing recommendation. At the time of review, Oracle’s Manage Compute documentation describes one driver and up to ten workers, each with AMD 2 OCPUs and 32 GB of memory. Autoscaling is enabled by default for Quickstart. Configured idle timeouts can stop inactive clusters, which resume when an attached workflow or notebook calls them. Check the available configuration in your tenancy when sizing a workload.

Quickstart is optimised for fast start-up. Oracle also notes that installing custom libraries changes it to a Custom configuration and can affect start-up performance. Include the actual library configuration in latency tests.

The sizing decision should distinguish scale-out from scale-up:

  • Scale out when the workload contains enough independent work to use more workers effectively.
  • Scale up when individual tasks, joins or the driver require more memory or CPU.

Neither approach solves an application that cannot use the additional resources. If one skewed partition contains most of the rows, nine workers may wait while one worker completes the dominant task. If the driver collects too much data or manages an extremely large execution plan, adding workers will not resolve driver pressure.

Cluster policy should also consider operating behaviour. Development clusters benefit from aggressive idle shutdown, while production schedules may justify warm clusters where start-up latency would breach a service-level objective. Separate compute for development and production also prevents exploratory notebooks from competing with scheduled pipelines.

Spark optimisation before adding compute

Spark is designed for distributed processing, but distribution is not free. Wide transformations such as large joins, groupings and repartitioning cause data to move between workers. This shuffle activity often determines the duration of a job more than the number of source rows.

The first optimisation pass should focus on the physical work Spark performs:

  • Filter rows and select required columns as early as possible.
  • Use built-in Spark SQL functions instead of Python user-defined functions where practical.
  • Inspect the execution plan and identify avoidable exchanges and repeated scans.
  • Broadcast only genuinely small lookup datasets.
  • Identify skewed join keys and treat them deliberately.
  • Check the runtime’s Adaptive Query Execution settings and the resulting plan before forcing join or partition choices.
  • Repartition for a known downstream join or write pattern, not as a reflex.
  • Cache an intermediate dataset only when it will be reused, and release it afterwards.
  • Monitor task duration, shuffle volume, spill, executor utilisation and failed tasks before resizing the cluster.

Apache Spark’s performance tuning documentation explains how caching, join strategies and Adaptive Query Execution affect the plan. Consult the documentation for the runtime you actually use.

A larger cluster can reduce elapsed time when there is real parallel work available. It can also increase cost without materially changing runtime when the job is constrained by skew, serial operations, external-system throughput or poor file layout.

Object Storage is part of the execution plan

Object Storage is durable and scalable, but a bucket is not automatically an efficient analytical dataset. Keep compute and storage in the same region where possible, and include the network path in any investigation of slow reads or writes. File format, file size, compression and folder layout affect how much metadata Spark must inspect, how many tasks are created and how much data must be read.

For analytical workloads, Parquet normally provides the right foundation because it is columnar, compressible and compatible with column pruning and predicate pushdown. The benefit is not simply smaller storage. A query selecting five columns from a wide dataset can avoid reading every column from every file.

The small-file problem deserves particular attention. Frequent incremental ingestion can create thousands or millions of tiny Parquet objects. Spark then spends disproportionate time listing, opening and scheduling work for those files. Compaction should therefore be treated as a normal maintenance operation for curated lake data, not as an emergency repair after performance deteriorates.

Partitioning should reflect real filtering patterns. A date-based folder structure may allow a daily process to avoid scanning years of history, while partitioning by a high-cardinality identifier may create an explosion of directories and tiny files. When the external table is configured with the appropriate implicit partitioning options, Autonomous AI Lakehouse can derive partition information from supported paths such as country=GB/year=2026/month=10/ and prune irrelevant files. Folder names alone are not a guarantee that every reader will prune them. Iceberg provides hidden partitioning and partition evolution; validate those capabilities against the table format and engine integration in use. Oracle’s October 2026 release note on Iceberg external table partition pruning describes database-side pruning using Iceberg partition metadata. Check the execution plan and measure the scan for your own table and filters.

Three distinct kinds of partition: Spark execution partitions divide data and work among tasks; that work may involve memory and disk. Object Storage or Iceberg partitions support file pruning. Database table partitions organise relational tables and indexes. They address different bottlenecks and should be designed separately.

Optimising Autonomous AI Lakehouse

When data becomes strongly structured and will be joined, aggregated and queried repeatedly, Autonomous AI Lakehouse becomes the natural serving and transformation engine. The first controls remain familiar: efficient SQL, appropriate service selection, representative optimiser statistics, sensible parallelism and enough ECPU capacity for the required concurrency.

Scaling database compute may improve a workload that is genuinely CPU-bound or requires more parallel execution. It will not compensate indefinitely for an inefficient join, a poor access path or repeatedly scanning external data that should be cached or loaded.

Automatic indexing

Automatic indexing analyses the observed SQL workload, creates candidate indexes, verifies their benefit and can remove indexes that are no longer useful. Oracle’s Autonomous AI Database Serverless documentation states that automatic indexing is disabled by default and that Real Application Testing must be enabled first. Teams should therefore verify the configuration rather than assume a newly provisioned service is already creating indexes automatically.

The feature is most valuable when the representative workload is allowed to run for long enough to expose recurring access patterns. It is less useful as a reaction to one poorly designed statement or a one-off bulk load. Index creation can improve selective queries, but indexes also consume storage and add work to inserts, updates and MERGE operations. The correct assessment therefore includes both query improvement and the effect on the loading window.

Automatic partitioning

Automatic partitioning analyses eligible tables and tests candidate strategies. Unlike automatic indexing, it does not run periodically in the background: you invoke the analysis explicitly through DBMS_AUTO_PARTITION.RECOMMEND_PARTITION_METHOD. REPORT ONLY allows recommendations to be assessed before applying changes to the target table; IMPLEMENT can apply a verified recommendation.

Oracle’s automatic partitioning guidance recommends performing the analysis on a clone or separate database. Verification creates auxiliary structures and runs workload tests, so REPORT ONLY does not mean resource-free or read-only analysis. Review the result against loading patterns and operational constraints, then schedule any production conversion appropriately.

Manually partitioned tables are excluded as candidates. This is database table partitioning, distinct from pruning Object Storage files or evolving an Iceberg partition specification.

Lake Cache and external data

External tables are valuable when data should remain in Object Storage, but repeated remote scans may not provide the latency required by interactive analytics. Lake Cache offers a middle position by materialising eligible external or mounted table data inside Autonomous AI Lakehouse. The lake remains the source, but the cache consumes database storage. Oracle documents policy-based and automatic caching. Automatic caching is off by default; allocating a cache quota alone does not enable it.

Define the required data freshness and refresh scope alongside the quota. A refresh policy that only creates new caches is different from one that refreshes existing cached data. Measure population and refresh costs as well as query latency, and test how source changes become visible.

This creates a useful continuum:

  1. Query in place when the data is accessed infrequently and avoiding duplication is more important than minimum latency.
  2. Cache external data when the lake remains the source and a database copy is justified for repeated queries.
  3. Load data into database tables when it supports frequent joins, dimensional models, incremental maintenance or high-concurrency BI.

Applying the approach to a Bronze, Silver and Gold pipeline

Consider an illustrative incremental source interface that supplies inserts and updates but never physical deletes. AIDP orchestrates the source query, writes each immutable delivery as Parquet into a Bronze Object Storage path and records the batch metadata. Silver processing uses the business key and a hash difference to distinguish new records from changed records before Gold models are prepared for analytics.

Batch metadata should identify exactly which files each run must process. An incremental delivery should not force every run to scan the complete Bronze history. Track successful processing, handle replay idempotently and define how multiple changes to the same business key are ordered. These are pipeline design responsibilities, not properties supplied by Parquet alone.

A performance-conscious implementation could use the following placement:

  • Bronze: retain source-aligned, immutable Parquet files with clear batch and ingestion-date paths. Avoid repeatedly rewriting this historical evidence layer.
  • Silver preparation: use Spark when schema normalisation, large-scale comparisons, complex cleansing or open-format lake outputs dominate. Compact incremental outputs so that repeated micro-batches do not create a permanent small-file problem.
  • Silver relational processing: use Autonomous AI Lakehouse when business-key matching, MERGE logic and repeatable relational joins can be expressed efficiently in SQL and the data is already database-resident.
  • Gold: favour database-resident dimensional models for predictable BI concurrency, governed SQL access and repeated aggregation. Evaluate automatic indexing against the reporting workload and automatic partitioning against the largest fact tables.
  • External Silver consumption: query in place for occasional access, but consider Lake Cache or loading when the same external tables become part of frequent interactive queries.

The answer does not have to be exclusively Spark or SQL. A strong AIDP design commonly uses Spark for the transformations that benefit from distributed file processing and Autonomous AI Lakehouse for the relational transformations and serving workloads that benefit from the database optimiser.

A repeatable decision framework

For each pipeline stage, four questions provide a defensible starting point:

  1. Where does the data currently reside?
  2. Which engine is naturally suited to the transformation?
  3. Where and how often will the result be consumed?
  4. Does moving the data cost more than the proposed optimisation saves?

Those questions lead to five recurring patterns:

  • Process in Spark and retain in the lake for large file transformations, data science and reusable open-format datasets.
  • Load then transform in SQL for structured relational data destined primarily for analytics.
  • Process in Spark and serve from the database for complex preparation followed by high-concurrency SQL consumption.
  • Query in place for cold or infrequently accessed datasets where duplication is not justified.
  • Cache or load external data when lake-resident datasets require more predictable repeat-query performance.

Measure the complete pipeline

Performance claims should be supported by representative measurements. Comparing only the execution time of one Spark stage with one SQL statement can be misleading if the comparison excludes cluster start-up, data movement, writes, downstream query time or cost.

A useful benchmark records:

  • Input volume and changed-row volume.
  • File count, file format and partition layout.
  • Cluster or database compute configuration.
  • Elapsed time for reading, transforming and writing.
  • Shuffle, spill and skew indicators for Spark.
  • Execution plans, statistics and access paths for SQL.
  • Data transferred between services.
  • Output size, repeat-query performance and approximate compute cost.
  • Output correctness, concurrent workload, and cold versus warm cache conditions.

The most useful comparison is often not Spark versus SQL in the abstract. It is the complete end-to-end pattern, including where the data begins, where it ends and how many times the output will be reused.

Conclusion

AIDP provides several powerful ways to process and serve data, but flexibility does not remove the need for architectural judgement. Spark cluster sizing, Parquet layout, lake partitioning, SQL design, automatic indexing, automatic partitioning and Lake Cache are all valuable controls. None of them can compensate fully for placing a workload in the wrong engine or moving data unnecessarily between services.

The most effective performance strategy therefore begins before tuning. Understand the workload, keep processing close to the data, choose the engine that matches the transformation, organise the data for that engine and measure the complete pipeline. Only then should additional compute be introduced.

Final takeaway: Do not begin by asking how large the Spark cluster or database should be. Begin by asking where the work should run.

Sources and further reading

Core product references rechecked on 25 November 2026. Workload-placement recommendations are architectural guidance, not measured benchmark results.