TheDeveloperBlog.com

Home | Contact Us

C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML

Cassandra Create Index

Cassandra Create Index for beginners and professionals with topics on architecture, relational vs no sql database, data model, cql, cqlsh, keyspace operations, table operations, installation, collections etc.

<< Back to CASSANDRA

Cassandra Create Index

CREATE INDEX command is used to create an index on the column specified by the user. If the data already exists for the column which you choose to index, Cassandra creates indexes on the data during the 'create index' statement execution.

Syntax:

CREATE INDEX <identifier> ON <tablename> 

Rules for creating Index

  • The index cannot be created on primary key as a primary key is already indexed.
  • In Cassandra, Indexes on collections are not supported.
  • Without indexing on the column, Cassandra can't filter that column unless it is a primary key.

Example:

Let's take an example to demonstrate how to create index on a column. Here we create an index to a column "student_name" in the table "student".

Prior table:

Cassandra Create index 1
CREATE INDEX name ON student (student_name); 
Cassandra Create index 2

Index is created on the column "student_name".

Note: You can verify that the index is created or not, by using the creating index query once again. It will show a message that index is already created.






Related Links:


Related Links

Adjectives Ado Ai Android Angular Antonyms Apache Articles Asp Autocad Automata Aws Azure Basic Binary Bitcoin Blockchain C Cassandra Change Coa Computer Control Cpp Create Creating C-Sharp Cyber Daa Data Dbms Deletion Devops Difference Discrete Es6 Ethical Examples Features Firebase Flutter Fs Git Go Hbase History Hive Hiveql How Html Idioms Insertion Installing Ios Java Joomla Js Kafka Kali Laravel Logical Machine Matlab Matrix Mongodb Mysql One Opencv Oracle Ordering Os Pandas Php Pig Pl Postgresql Powershell Prepositions Program Python React Ruby Scala Selecting Selenium Sentence Seo Sharepoint Software Spellings Spotting Spring Sql Sqlite Sqoop Svn Swift Synonyms Talend Testng Types Uml Unity Vbnet Verbal Webdriver What Wpf