#####create keyspace/table # use system; drop keyspace test; #CREATE KEYSPACE test WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 2 }; CREATE KEYSPACE test WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 }; #describe keyspaces; describe keyspace test; use test; create table test(id varchar primary key, value text) with bloom_filter_fp_chance=1; alter table test with bloom_filter_fp_chance=1; desc test.test; insert into test(id,value)values('testid','testvalue'); select * from test.test; delete from testwhere id='testid'; select * from test.test; #default 0.01, use 1 to disable bloomfilter and save memory create table content (id varchar primary key, content text) with bloom_filter_fp_chance=1; #default 0.01, use 1 to disable bloomfilter and save memory alter table content with bloom_filter_fp_chance=1; #disable compression alter table content WITH compression = { 'sstable_compression' : '' }; alter table content WITH compression = { 'sstable_compression' : 'LZ4Compressor' }; alter table content WITH compression = { 'sstable_compression' : 'DeflateCompressor'}; alter table content WITH compression = { 'sstable_compression' : 'DeflateCompressor', 'chunk_length_kb' : 64 }; select * from content; ~~select * from system.schema_keyspaces;~~ desc keyspaces; desc keyspace test; describe tables; describe table content;
#####import from file copy content(id,content ) from 'g:\t\test.content.data.csv';
##### use test; select count(*) from content limit2147483647; select * from content where id='01435a9f57718a8080e44358b3ff060b';
#
insert into content (id,content) values(‘test’,’test中文許功蓋’);