Database Reference
In-Depth Information
Let's take a look at the following example:
ALTER TABLE modify_me
WITH
default_time_to_live = 3600
AND
compaction = {
'class': 'LeveledCompactionStrategy',
'sstable_size_in_mb': 314
}
AND
speculative_retry = '75percentile'
AND
comment = 'New and improved formula';
Dropping a table
Dropping a table is the simplest of all the commands. All you have to do is execute a
query in the following pattern:
DROP TABLE IF EXISTS table_name;
Creating an index
Unlike relational databases, if you try to perform a search on a column that is not the
primary key, it will not work. One may argue the feasibility of going through all the rows
sequentially and finding out the records matching the criteria, but Cassandra is meant for
large datasets and performing a linear search on hundreds of gigabytes of records is just
impractical. Allowing so may cause malpractice. So, consider a simple table like this:
SELECT * FROM searchable_tab;
id | age | name | phones
----+-----+--------------+----------------------------------
1 | 21 | Misa Amane | {'111-222-3333', '111-223-4444'
2 | 26 | Light Yagami | {'111-277-0563'}
3 | 666 | Ryuk | {'000-000-0000'}
(3 rows)
Here, a simple query like this wouldn't work:
Search WWH ::




Custom Search