Building on all the suggestions here, let me provide a comprehensive optimization approach that addresses all three key areas: indexed query filters, partitioned tables, and report caching.
1. Indexed Query Filters Implementation:
First, create composite indexes that match your query patterns:
CREATE INDEX idx_qi_date_plan ON quality_inspections(inspection_date, plan_name, inspection_id);
CREATE INDEX idx_qr_inspection ON quality_results(inspection_id, defect_count);
The composite index on quality_inspections covers your WHERE clause and JOIN column, allowing index-only scans. This alone should reduce execution time by 60-70%.
2. Partitioned Tables Strategy:
Implement range partitioning on inspection_date:
-- Pseudocode - Key partitioning steps:
1. Create partitioned table quality_inspections_part with RANGE partitioning on inspection_date
2. Define monthly partitions for current year plus 2 prior years
3. Set up automatic partition creation for future months
4. Create local indexes on each partition for inspection_id and plan_name
5. Migrate existing data using parallel INSERT SELECT operations
6. Update BI Publisher data model to reference partitioned table
Partitioning enables partition pruning - when you query for a specific month, Oracle only scans that partition. With 50K records distributed across 36 monthly partitions, you’re now scanning ~1,400 records instead of 50K.
3. Report Caching Configuration:
In BI Publisher, configure the quality control report with these cache settings:
- Enable report caching in the Data Model properties
- Set cache expiration to 12 hours for current month reports, 7 days for historical months
- Use parameter-based cache keys (inspection_date range) so different date ranges maintain separate cache entries
- Configure cache refresh schedules to align with your nightly inspection data loads
4. Query Optimization:
Revise your query to leverage the new indexes and partitions:
SELECT /*+ INDEX(qi idx_qi_date_plan) */
qi.inspection_id, qi.plan_name, qr.defect_count
FROM quality_inspections qi
JOIN quality_results qr ON qi.inspection_id = qr.inspection_id
WHERE qi.inspection_date BETWEEN :start_date AND :end_date
AND qi.inspection_date >= TRUNC(:start_date, 'MM')
The additional TRUNC predicate helps Oracle identify the exact partition for monthly reports.
Expected Results:
With all three optimizations implemented, you should see:
- Initial query execution: 45-90 seconds (down from 8 minutes)
- Cached report retrieval: 2-5 seconds
- Minimal impact on daily inspection data loads (typically <5% overhead)
Implementation Order:
Start with indexes (quickest win, no downtime), then implement caching (configuration change only), and finally plan the partitioning migration during a maintenance window. Monitor query performance after each step to validate improvements.
The insert performance concern is manageable - modern Oracle versions handle index maintenance efficiently, and you can use NOLOGGING options during bulk loads if needed.
This draft is based on general Oracle Fusion Cloud knowledge. It has not been verified against your specific version and environment. Practitioners: verify the steps and share your experience below.