Cassandra (一)

 

 

 

 

 

 

 

 

 

 

 关于联合索引是否能起作用?使用where一定要带上主索引a!!!!否则不生效!!!!

 

 

create keyspace patient with replication = {'class':'SimpleStrategy','replication_factor: 1'}
create table patient.exam(
patient_id int,
doctor text static,
start_date timeuuid,
detail text,
primary key(patient_id,start_date));

insert into patient.exam(patient_id,doctor) values(123,'JOHN M');

insert into patient.exam(
patient_id,
start_date,
detail
) values(123,maxTimeuuid('1999-01-01 00:05+0000'),'first exam')

select toDate(start_date) from patient.exam;
## static 绑定主id

 

 

 

 

 

 

 

 

 

 

 

posted @ 2020-12-31 13:38  PEAR2020  阅读(74)  评论(0编辑  收藏  举报