cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kurt greaves <>
Subject Re: Smart Table creation for 2D range query
Date Tue, 09 May 2017 03:06:53 GMT
Note that will not give you the desired range queries of 0 >= x <= 1 and 0
>= y <= 1.

​Something akin to Jon's solution could give you those range queries if you
made the x and y components part of the clustering key.

For example, a space of (1,1) could contain all x,y coordinates where x and
y are > 0 and <= 1. You would then have a table like:

CREATE TABLE geospatial (
space text,
x double,
y double,
item text,
primary key ((space), x, y, m1, m2, m3, m4, m5)

A query of select * where space = '1,1' and x <1 and x >0.5 and y< 0.2 and
y>0.1; should yield all x and y pairs and their distinct metadata. Or
something like that anyway.

View raw message