- First, we need to create the database (keyspace) and choose how our nodes will replicate the data:
CREATE KEYSPACE mydb WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 };
- Now, we create a table:
CREATE TABLE tb_drive ( id uuid PRIMARY KEY, wheel_angle float, acc float, image blob );
- Add some data as follows:
INSERT INTO tb_drive (id,wheel_angle,acc) VALUES (now(),0.2,0.5);
INSERT INTO tb_drive (id,wheel_angle,acc) VALUES (now(),0.1,0.5);
INSERT INTO tb_drive (id,wheel_angle,acc) VALUES (now(),0.0,0.5);
- Create indexes (at any point in time) to all the columns that you want to query (that's why is fast):
CREATE INDEX idxAngle ON tb_drive (wheel_angle);
CREATE INDEX idxAcc ON tb_drive (acc);