Benchmarking Results: Internal vs External Table in Oracle Autonomous Data warehouse with 1 Billion Records
In this benchmarking test, the objective was to compare the query performance between an internal relational table and an external table (created from a Parquet file in OCI Object Storage) in Oracle ADW
The Parquet file contained 1 billion records, and the same data was loaded into both an internal ADW table and an external table using the Parquet file as the data source.
Queries were executed using SQL Developer
SET TIMING ON;
-- Query to count rows in the internal table
SELECT COUNT(*) FROM internal_table;
-- Query to count rows in the external table (Parquet-based)
SELECT COUNT(*) FROM BIG_EXTERNAL_TABLE;
Execution Plans
Internal Table Execution Plan:
• Operation: TABLE ACCESS STORAGE FULL — Oracle retrieves data directly from its optimized storage.
• resourceCost: 4329
• Result Cache: Enabled, allowing Oracle to cache the result for faster retrieval in subsequent queries.
• Parallelism: Automatic Degree of Parallelism (DOP) set to 12.
External Table Execution Plan:
• Operation: EXTERNAL TABLE ACCESS STORAGE FULL — Oracle retrieves data from OCI Object Storage, involving more overhead.
• resource Cost: 16785 (significantly higher than the internal table due to accessing external storage).
• Result Cache: Not enabled, so each query requires fetching data from Object Storage without caching.
• Parallelism: Automatic DOP set to 12, similar to the internal table.
Key differences between this 2 strategy
(1)in terms of result cache - internal table uses result cache but external tables does not. Result caching typically improves performance especially for repeated queries
(2)as per sql plan - the overall resource cost was much higher for external parquet table - external table query requires more resources
(3)internal table uses - TABLE ACCESS STORAGE FULL on an Oracle-managed storage system, while the external table uses EXTERNAL TABLE ACCESS STORAGE FULL, accessing Object Storage, which involves more overhead
Timing Results
• Internal Table: 0.1 seconds
The internal table query was fast, completing in just 0.1 seconds. This speed is largely due to the result caching and the optimized ADW storage.
• External Table: 12-15 seconds
The query on the external Parquet table took considerably longer, ranging from 12 to 15 seconds. This is because the data had to be retrieved from OCI Object Storage, and the lack of result caching added to the latency.
Comments
Post a Comment