-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
Description
When indexing in glint, it'd be helpful to be able to eager load the spatial cache to avoid thousands of queries like this:
SpatialCache Load (0.4ms) SELECT "spatial_caches".* FROM "spatial_caches" WHERE "spatial_caches"."spatial_model_id" = $1 AND "spatial_caches"."spatial_model_type" = $2 AND "spatial_caches"."intersection_model_type" = 'Site' ORDER BY "spatial_caches"."id" ASC LIMIT 1 [["spatial_model_id", 224037], ["spatial_model_type", "Encumbrance"]]
The complication is that there is an association for spatial cache, but we're adding a model type query to the end, so it can't use the eager loaded association.