Explore Sample Data with Data Tools
- tutorial
Use Couchbase Capella’s Data Tools to explore and work with your data.
Your trial database comes with a sample dataset. You can use this data to try out Capella’s Data Tools.
To start exploring your data, you can:
-
View and edit documents through the Documents Viewer.
-
Run a SQL++ query through the Query tab.
-
Speed up your queries with an index.
View and Edit Documents with the Documents Viewer
Documents in Capella are grouped through buckets. You can add scopes and collections to a bucket to group related documents together.
For more information about buckets, scopes, and collections, see Data Service.
To view and edit a document in your database:
-
Go to
. -
In the Limit field, enter
8
. -
In the travel-sample bucket in the database schema browser (left pane), navigate to the airport collection in the inventory scope.
-
Hover over the airport collection until get documents appears, and click get documents.
-
In the right pane, click airport_1261.
-
In the Edit Document window, change the airport’s
city
from"Amiens"
to"Rouen"
. -
Click Save Document.
The document airport_1261 now has its city
set to "Rouen"
.
Run Your First Query with the Query Tab
To run your first query:
-
Go to
. -
In the query editor, paste the following query:
SELECT route.airlineid, airline.name, route.sourceairport, route.destinationairport FROM `travel-sample` route INNER JOIN `travel-sample` airline ON route.airlineid = META(airline).id WHERE route.type = "route" AND route.destinationairport = "SFO" ORDER BY route.sourceairport;
-
Press Enter or click Run Query.
The results from the query are displayed in JSON format.
To view how Capella executed the query in a graphical format, select the Plan tab. The Query results show a data-flow diagram with query operators. The initial scans display on the right, and the final output of the query displays on the left. The Query results highlight any operators that might use a lot of resources. For example, in this query, the Fetch operator takes almost 90% of the total time spent on the query. |
For more information about how to use the tools on the Query tab, see Query Tab.
Speed Up Your Query with an Index
You can use the Index Service to improve query performance:
-
With the same query in the query editor, click Index Advice.
-
In the query results, copy the recommended
CREATE INDEX
command from theindex_statement
attribute without the quotation marks: -
Replace the query in the query editor with the
CREATE INDEX
command. -
To create the index, click Run Query.
-
Click History.
-
To load the original query back into the query editor, in the list of queries, click the
SELECT
query. -
To run the query again, click Run Query.
With the index, the query execution time changes from around 172ms to 24ms.
For more information about indexes in Capella, see Index Service.
Next Steps
After you query sample data, you can Explore the SDK Playground to see how to access your data with the Couchbase SDKs.
You can also Import your own data and Configure App Services for your trial database.
If you want to connect to your database:
-
Generate database credentials to securely connect and control access to your database. For more information, see Configure Database Credentials
-
Add your current IP address as an allowed IP for your database. For more information, see Configure Allowed IP Addresses
-
Generate a Code Snippet that helps you connect your database to your application.
-
Choose and install a Couchbase SDK
-
(Optional) Download the security certificate for your database and add it to your application’s server machine or IDE:
-
From the Start page, go to
. -
Click Download.
-