possible host retrieval optimization
allocateLeases6 retrieves client leases using IA type, DUID and IAID, and filters the result using the subnets of the shared network.
renewLeases6 retrieves client leases using IA type, DUID, IAID and subnet ID, and merges results iterating the subnets of the shared network.
Both ways get exactly the same list of leases but with different database queries.
Outside shared network the subnet ID narrows the search so it lightly more efficient. In a shared network it uses one query per subnet so is clearly less efficient.
In conclusion the idea is to factor the two retrievals and to use the best way according to in/outside a shared network.