Skip to content

Make it possible to eager load spatial cache #6

@njakobsen

Description

@njakobsen

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions