Write a SQL query to identify duplicate records in a large transactional dataset and explain how you would optimize it.
Assume a duplicate has the same source system, account, transaction date, transaction type, and amount. Use the provided transaction and source-system tables.
| Column | Type | Description |
|---|---|---|
| transaction_idPK | BIGINT | Unique transaction identifier |
| source_system_id | INT | Identifier of the originating source system |
| account_id | VARCHAR(30) | Account associated with the transaction |
| transaction_date | DATE | Business date of the transaction |
| transaction_type | VARCHAR(20) | Transaction classification |
| amount | NUMERIC(12,2) | Transaction amount |
| Column | Type | Description |
|---|---|---|
| source_system_idPK | INT | Unique source-system identifier |
| source_name | VARCHAR(80) | Readable source-system name |