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

Using ST_DWithin with indexes #1251

Open
j3r3m1 opened this issue Jan 19, 2022 · 2 comments
Open

Using ST_DWithin with indexes #1251

j3r3m1 opened this issue Jan 19, 2022 · 2 comments

Comments

@j3r3m1
Copy link
Contributor

j3r3m1 commented Jan 19, 2022

I wonder whether ST_DWithin can be used with ST_EXPAND to use the indexes and limit the number of geometries tested. We do that in GeoClimate but I am not sure it is actually efficient:
https://github.com/orbisgis/geoclimate/blob/78c95a53deb24e1e61570276927ba03fbc194676/geoindicators/src/main/groovy/org/orbisgis/geoclimate/geoindicators/RsuIndicators.groovy#L199

In PostGis they can create an index directly on an expand, which would probably lead to better performance:
CREATE INDEX ON broadcasting_towers using gist (ST_Expand(geom, sending_range));

Is there such possibility in H2 ?

@ebocher
Copy link
Member

ebocher commented Jan 25, 2022

H2 supports only column.
So this kind of command

CREATE SPATIAL INDEX ON broadcasting_towers  (ST_Expand(geom, sending_range));

perhaps in the future ;-)

@katzyn Am I right ?

@katzyn
Copy link

katzyn commented Jan 25, 2022

Current documentation of CREATE INDEX is up to date:
https://h2database.com/html/commands.html#create_index

H2 doesn't support partial indexes and indexes on expressions, but supports indexes on computed columns. Index on computed column can only be used if this computed column is used directly in the filter criteria of the query with a compatible operator on the top level or within an AND.

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

No branches or pull requests

3 participants