Remove GROUP BY clause from CellMapping.get_by_project_id
Remove GROUP BY clause from CellMapping.get_by_project_id

Under postgresql, the GROUP BY clause in this query fails with:

  DBError: (psycopg2.ProgrammingError) column "instance_mappings.created_at"
  must appear in the GROUP BY clause or be used in an aggregate function

And we're getting lucky with using this under mysql because we don't
have the ONLY_FULL_GROUP_BY mode set (but we probably should).

This change removes the GROUP BY clause and re-writes the query
to avoid the joinedload() from the instance_mappings table and
simply do a subquery to get the cell_ids and then do a simple
IN query with the cell_mappings table. This fixes the GROUP BY
issue and should also make the query more efficient since we
won't have to load InstanceMappings ORM objects.

Change-Id: Idc9b5ad019205f447c82a702dd3391fa5dd20228
Closes-Bug: #1804271

mahak/nova,rahulunair/nova,rahulunair/nova,openstack/nova,mikalstill/nova,klmitch/nova,mikalstill/nova,klmitch/nova,rahulunair/nova,mahak/nova,klmitch/nova,openstack/nova,mikalstill/nova,openstack/nova,klmitch/nova,mahak/nova