Hi Lydia,

Yes. This will define the x, y columns as the components of the partition key. Note that by doing this both x and y values will be required to at a minimum to perform a valid query.

Alternatively, the x and y values could be combined in into a single text field as Jon has suggested.

Kind regards,
Anthony

On 7 May 2017 at 17:15, Lydia Ickler <icklerly@googlemail.com> wrote:
Like this?

CREATE TABLE test (
  x double,
  y double,
  m1 int,
  ...
  m5 int,
  PRIMARY KEY ((x,y), m1, … , m5)
) 


Am 05.05.2017 um 21:54 schrieb Nitan Kainth <nitan@bamlabs.com>:

Make metadata as partition key and x,y as part of partition key i.e. Primary key. It should work

Sent from my iPhone

On May 5, 2017, at 2:40 PM, Lydia <icklerly@googlemail.com> wrote:

Hi all,

I am new to Apache Cassandra and I would like to get some advice on how to tackle a table creation / indexing in a sophisticated way.

My aim is to store x- and y-coordinates, accompanied by some columns with meta information (m1, ... ,m5). There will be around 100,000,000 rows overall. Some rows might have the same (x,y) pairs but always distinct meta information.

In the end I want to do a rather simple range query in the form of e.g. (0 >= x <= 1) AND (0 >= y <= 1).

What would be the best choice of variables to set as primary key, partition key. Or should I use a index? And if so on what column(s)?

Thanks in advance!
Best regards,
Lydia
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@cassandra.apache.org
For additional commands, e-mail: user-help@cassandra.apache.org