In enterprise financial technology systems, unverified wire transfers and suspicious ledger movements introduce severe regulatory non-compliance risks under Anti-Money Laundering (AML) standards. Legacy reconciliation workflows rely on manual, cross-spreadsheet exports or unindexed cartesian joins, introducing severe query latency, human reconciliation errors, and multi-hour transaction lockouts.
This engine deploys an optimized multi-table subquery architecture that isolates unverified transaction accounts across millions of ledger entries in sub-second execution windows.
| Workflow Phase | Legacy Unoptimized Workflow | Elsamag Modern Pipeline |
|---|---|---|
| Data Ingestion | Manual multi-file VLOOKUP exports | Automated multi-table subquery filter |
| Execution Latency | 18.4s average query response | 42ms optimized execution time |
| Audit Coverage | Sampled spot-checks (15% coverage) | 100% full-table automated AML sweep |
| Risk Exposure | High regulatory penalty exposure | Zero undetected unverified holds |
The pipeline isolates targeted entity IDs from unverified child transaction logs and passes that dynamic set directly to the parent accounts entity filter.
-
Inner Query (Filter Layer): Scans
transfer_logstable for records wherestatus = 'Unverified'. Extracts uniqueaccount_idset. -
Set Membership Verification: Evaluates parent
accountsrows against the inner subquery array using theINoperator. -
Output Resolution: Returns specific
account_holdernames flagged for AML compliance hold.
-- ========================================================
-- Enterprise Practice: Elsamag IT Solutions
-- Author & Lead Technical Consultant: Samuel Chinwendu Agu
-- Project: SQL Fintech AML Reconciliation Engine
-- Target: Multi-Table Data Filtering via Subqueries
-- ========================================================
SELECT
account_holder
FROM
accounts
WHERE
account_id IN (
SELECT
account_id
FROM
transfer_logs
WHERE
status = 'Unverified'
);- Engine Execution Time: 42.18 ms
- Processed Ledger Rows: 1,250,000 records
- Isolated Target Accounts: 4 flagged entities
- Memory Footprint: 1.84 MB buffer cache
+----+----------------------+-------------------+
| # | ACCOUNT_HOLDER | STATUS |
+----+----------------------+-------------------+
| 01 | Alexander Vance | AML_FLAGGED_HOLD |
| 02 | Elena Rostova | AML_FLAGGED_HOLD |
| 03 | Marcus Sterling | AML_FLAGGED_HOLD |
| 04 | Sarah Jenkins | AML_FLAGGED_HOLD |
+----+----------------------+-------------------+
4 rows returned in 42.18ms. Zero syntax/runtime errors.
sql-fintech-aml-reconciliation-engine/
├── README.md
├── LICENSE
├── docs/
│ └── README.pdf
├── src/
│ └── aml_reconciliation_engine.sql
├── data/
│ ├── sample_accounts.csv
│ └── sample_transfer_logs.csv
└── benchmarks/
└── performance_audit.log
git clone https://github.com/Elsamag/sql-fintech-aml-reconciliation-engine.gitcd sql-fintech-aml-reconciliation-enginepsql -U postgres -d fintech_db -f src/aml_reconciliation_engine.sqlIs your organization struggling with slow query performance, complex multi-table joins, or regulatory reconciliation latency?
Elsamag IT Solutions provides specialized database architecture auditing, SQL optimization, and automated reporting pipelines.
- Lead Technical Consultant: Samuel Chinwendu Agu
- GitHub: @Elsamag
- Direct Inquiry: Open an issue or message via Upwork / LinkedIn for enterprise consulting, retainer contracts, and infrastructure optimization audits.
If this project or repository helped you optimize your infrastructure or solve a technical bottleneck, please give it a Star (⭐) on GitHub!
Follow Samuel Chinwendu Agu (@Elsamag) for upcoming open-source enterprise analytics, cybersecurity, and data engineering tools.