Reader small image

You're reading from  Learning Couchbase

Product typeBook
Published inNov 2015
Publisher
ISBN-139781785288593
Edition1st Edition
Right arrow
Author (1)
Henry Potsangbam
Henry Potsangbam
author image
Henry Potsangbam

Henry Potsangbam is an experienced software developer, administrator, and architect with more than 14 years of experience in enterprise application architecture, design, and development. He's worked in various domains, such as e-commerce, retail, and energy sectors. He is an IBM certified application and solution developer, SAP Certified Netweaver EP Consultant and CIPM (project management). Always fascinated by and interested in exploring emerging technologies to solve business scenarios, Henry has been following NoSQL and Couchbase since its initial release around 2011. In his spare time, he explores, and educates professionals in big data technologies such as Hadoop (Mapr, Hortonworks, and Cloudera), enterprise integration (camel, fuse esb, and Mule), analytics with R, messaging with kafka, rabbitMQ, the OSGI framework, NoSQL (Couchbase, Cassandra, and Mongodb), enterprise architecture, and so on. During his career, he architect private cloud implementation using virtualization for one of the fortune 500 company. He also played active role in provisioning infrastructure for one of the largest cash transfer programme in the world.
Read more about Henry Potsangbam

Right arrow

Indexing properties


Querying an unindexed property causes the server to scan the entire bucket and check that property on every document. You can create indexes with the following syntax:

CREATE INDEX Index_name
ON LearningCouchbase(name)

Here, Index_name is the name of the index you want to create, LearningCouchbase is the name of the bucket, and name is the attribute of documents in which you want to create the index.

Note

One thing you need to remember is that you cannot execute any N1QL query until you create a primary index with the query shown next.

CREATE PRIMARY INDEX ON LearningCouchbase

Views

When you create indexes on a bucket; internally, Couchbase creates views on your behalf. As shown in the preceding screenshot, you can find views in the view editor after you create indexes.

Explaining a query

Sometimes, we like to know how queries will be executed in the Couchbase cluster. It helps us to tune it while in the development phase. You just need to append the EXPLAIN keyword before...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Learning Couchbase
Published in: Nov 2015Publisher: ISBN-13: 9781785288593

Author (1)

author image
Henry Potsangbam

Henry Potsangbam is an experienced software developer, administrator, and architect with more than 14 years of experience in enterprise application architecture, design, and development. He's worked in various domains, such as e-commerce, retail, and energy sectors. He is an IBM certified application and solution developer, SAP Certified Netweaver EP Consultant and CIPM (project management). Always fascinated by and interested in exploring emerging technologies to solve business scenarios, Henry has been following NoSQL and Couchbase since its initial release around 2011. In his spare time, he explores, and educates professionals in big data technologies such as Hadoop (Mapr, Hortonworks, and Cloudera), enterprise integration (camel, fuse esb, and Mule), analytics with R, messaging with kafka, rabbitMQ, the OSGI framework, NoSQL (Couchbase, Cassandra, and Mongodb), enterprise architecture, and so on. During his career, he architect private cloud implementation using virtualization for one of the fortune 500 company. He also played active role in provisioning infrastructure for one of the largest cash transfer programme in the world.
Read more about Henry Potsangbam