CiviCRM is creating a lot of orphaned records in civicrm_address with contact_id NULL and master_id NULL
CiviCRM is creating a lot of orphaned records in civicrm_address with contact_id NULL and master_id NULL. For some CiviCRM sites there are a few hundred orphaned records, for other CiviCRM sites there are more than 1,000 records.
You can easily locate them by querying:
`SELECT COUNT(*) FROM civicrm_address WHERE contact_id IS NULL;
And also you can find these orphaned records by excluding addresses created by Event locations.
SELECT * FROM civicrm_address a WHERE a.contact_id is null and a.is_billing=1 AND NOT EXISTS (SELECT id FROM civicrm_loc_block l WHERE l.address_id=a.id);
Monitoring the civicrm_address table, it is possible to identify that the orphaned addresses are created when submitting a new Contribution.
Agileware Ref: CIVICRM-1562