FC Monogram Crest
Francesco Castaldi
PILLAR III • DATA-SCIENCEFOLIO ID: sql-performance-copilot

SQL Performance Copilot: Multi-Dialect Query Execution Plan Analyzer

Developed to support Healthcare Business Consulting and clinical Data Warehouse engineering. Parses XML/JSON execution plans and AWR/DMV telemetry across Oracle, Microsoft SQL Server, PostgreSQL, and IBM DB2, detecting sargability violations, missing covering indexes, key lookups, and cardinality estimation skews, while generating deterministic rewrite patches.

SQLOracleSQL ServerPostgreSQLQuery OptimizationHealthcare ITETL
Multi-dialect SQL query execution plan analyzer and index optimization pipeline diagram for healthcare databases

Healthcare Data Warehouse Bottlenecks

Hospital Information Systems (HIS), Emergency Department tracking boards, and regional healthcare ETL pipelines process tens of millions of clinical episodes daily. Slow SQL queries degrade clinician UX and delay nightly regulatory data marts.

ARCHIVAL EXCERPT
[!IMPORTANT] > SQL Performance Copilot automates execution plan inspection across heterogeneous hospital RDBMS engines, pinpointing high-cost operators and synthesizing non-breaking index and CTE refactoring scripts.

Multi-Dialect Optimization Benchmarks

Evaluated on production-scale clinical and administrative query workloads:

Database EngineAnti-Pattern DetectedRecommended TransformationLatency BeforeLatency After
SQL Server 2019Implicit `CONVERT_IMPLICIT` + Key LookupSargable predicate + Covering Index `INCLUDE`14.8 s180 ms
Oracle 19cCorrelated Subquery in `SELECT` listHash Join Window Function (`ROW_NUMBER`)42.0 s1.15 s
PostgreSQL 16Non-indexed JSONB path scanGIN expression index + materialized CTE6.4 s45 ms
IBM DB2Unbounded range scan on timestampPartition-pruned `BETWEEN` window28.5 s890 ms

*Table 1: Multi-Dialect SQL Tuning Benchmarks in Healthcare Environments*

-- Example: Sargable Temporal Rewrite & Covering Index Recommendation
CREATE NONCLUSTERED INDEX IX_EpisodiPS_DataAccettazione_Covering
ON dbo.EPISODI_PRONTO_SOCCORSO (DATA_ACCETTAZIONE ASC, COD_PRESIDIO ASC)
INCLUDE (ID_PAZIENTE, COD_TRIAGE, ESITO_DIMISSIONE, MINUTI_ATTESA);

Key Capabilities

- AST Sargability Verifier: Flags functions wrapping indexed columns in `WHERE` and `JOIN` clauses. - Cardinality Skew Detector: Identifies discrepancies between estimated and actual row counts that trigger suboptimal Nested Loops or TempDB spills. - Safe DDL Generator: Outputs online index creation scripts with `ONLINE = ON` and `SORT_IN_TEMPDB = ON` for zero-downtime hospital maintenance windows.

LINKED COMPETENCIES & ARCHIVAL TRACEABILITY

sql-db↗Healthcare Information Technology & BI Consulting↗Data Science & Analytics↗
Examine Upstream Repository
Return to Selected Work