Open JannikZed opened 6 months ago
I created a small PR for that https://github.com/notum-cz/strapi-plugin-location/pull/183 we should just decide, if we want to add database index creation here as well. this change shouldn't break anything, as we leave the typecast in the query.
Bug report
I just realized, that this plugin is creating _geom fields for every coordinate entry. The column is actually using GIST "geometry". All queries that are produced through the plugin are looking like this:
so are casted on the fly from geometry to geography. As this plugin is just working with geopoints, I would recommend to move from geometry directly to geography and directly set an index on it. I tried it out on my data and came down from 1 second to 0,037 seconds for the same data with this approach. Everything works the same, just the query looks like this:
I would recommend to set an index on the geom fields directly (or should we let the customer decide that with a setting flag?