Possible optimization of large query
The query to retrieve the Quadkeys of tiles without reference entities (used by the Initializer)
sql_statement = f"""
SELECT A.quadkey, built_area_size
FROM
(
SELECT quadkey, built_area_size
FROM {self.tile_view}
WHERE quadkey IN ({quadkeys_in_batch}) AND built_area_size IS NOT NULL
) AS A
LEFT JOIN
(
SELECT quadkey FROM EntityReference
WHERE quadkey IN ({quadkeys_in_batch})
) AS E
ON E.quadkey = A.quadkey
WHERE E.quadkey IS NULL
"""
can possibly be optimized by removing the line WHERE quadkey IN ({quadkeys_in_batch})
. This needs to be tested on large countries like China or India.