Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it possible to eager load spatial cache #6

Open
njakobsen opened this issue Jul 26, 2016 · 0 comments
Open

Make it possible to eager load spatial cache #6

njakobsen opened this issue Jul 26, 2016 · 0 comments

Comments

@njakobsen
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant