issue #24381 - restructuring reduces the number of table scans

This improves performance on a moderately-sized db by a factor of 5 when searching for a single `addr_id` and a factor of 4 when searching by `crmacct_id`. In addition, `select * from address` now returns at least one row for each `addr` while the previous version missed some addresses.