You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DOC-11228: IA Query Rework — Getting System Information page (#224)
* Move non-monitoring catalogs to the system information page
* Move Logical Hierarchy from System Information to Query Concepts
* Add Profiling Summary table
* Move table of catalogs from Manage and Monitor Queries to System Info
* Copy Authentication from Manage and Monitor Queries to System Information
* Update intro and reinstate information on how to access the keyspaces
* Tidy up Query Concepts
* Tidy up Get System Information
* Update links to system catalogs
* Update links to logical hierarchy
* Update N1QL Management overview page
* Add table styles to Manage and Monitor Queries
Copy file name to clipboardExpand all lines: modules/n1ql/pages/n1ql-intro/queriesandresults.adoc
+56-12Lines changed: 56 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -72,18 +72,62 @@ SELECT name, brewery_id from `beer-sample` WHERE brewery_id IS NOT MISSING LIMIT
72
72
}
73
73
----
74
74
75
-
[#keyspace-reference]
76
-
== Keyspace References
75
+
[#logical-hierarchy]
76
+
== Logical Hierarchy
77
77
78
78
Couchbase stores data within a xref:clusters:data-service/about-buckets-scopes-collections.adoc[logical hierarchy] of buckets, scopes, and collections.
79
79
This enables separation between documents of different types.
80
+
81
+
Datastores::
82
+
83
+
Datastores are similar to sites.
84
+
A datastore is a database deployment, for example, a server cluster, cloud service, or mobile installation.
85
+
It is analogous to a relation database instance.
86
+
87
+
Namespaces::
88
+
89
+
Namespaces are similar to pools.
90
+
A namespace is a unit of authorization, resource allocation, and tenancy.
91
+
It is analogous to a relational database or schema.
92
+
Currently, only the `default` and `system` namespaces are available.
93
+
94
+
Buckets::
95
+
96
+
A bucket is the fundamental space for storing data in Couchbase Capella.
97
+
Each bucket contains at least one scope by default, and you can create more scopes as required.
98
+
It is analogous to a relational database table space or file group.
99
+
100
+
Scopes::
101
+
102
+
A scope is a set of one or more collections.
103
+
Each scope contains at least one collection by default, and you can create more collections as required.
104
+
It is analogous to a group of relational database tables.
105
+
106
+
Collections::
107
+
108
+
A collection is a set of documents that may vary in structure.
109
+
It is a unit of authorization and resource allocation.
110
+
It is analogous to a relational database table.
111
+
112
+
Keyspaces::
113
+
114
+
Keyspaces map to collections in Couchbase Capella.
115
+
You must refer to a keyspace using a <<keyspace-reference,keyspace reference>>.
116
+
+
117
+
The term keyspace is also used to refer to any of the catalogs in the xref:n1ql:n1ql-intro/sysinfo.adoc[system] namespace.
118
+
119
+
[#keyspace-reference]
120
+
== Keyspace References
121
+
80
122
For most queries, you must provide one or more keyspace references to specify the data sources for the query.
81
123
82
124
A keyspace reference may be:
83
125
84
-
* A _full_ keyspace reference: a path comprising the bucket, the scope, and the collection which contains the documents you want.
126
+
* A [dfn]#full keyspace reference#: a path comprising the optional namespace, the bucket, the scope, and the collection which contains the documents you want.
127
+
For example, `default:{backtick}travel-sample{backtick}.inventory.airline`.
85
128
86
-
* A _partial_ keyspace reference, comprising the collection name only.
129
+
* A [dfn]#partial keyspace reference#, comprising the collection name only.
130
+
For example, `airline`.
87
131
88
132
When a query contains partial keyspace references, you must set the <<query-context,query context>> to specify a bucket and scope before running a query.
89
133
Partial keyspace references are resolved using the bucket and scope supplied by the query context.
@@ -94,7 +138,7 @@ In this case, the <<query-context,query context>> must not be set.
94
138
[#query-context]
95
139
== Query Context
96
140
97
-
The [def]_query context_ specifies the the namespace, bucket, and scope used to resolve partial keyspace references.
141
+
The [dfn]#query context# specifies the the namespace, bucket, and scope used to resolve partial keyspace references.
98
142
99
143
When the query context is set, you can refer to a collection using just the collection name, without having to enter the keyspace path.
100
144
When the query context is not set, it defaults to the `default` namespace, with no bucket, scope, or collection.
@@ -113,10 +157,10 @@ This can be used to support the separation of tenant data in a multi-tenancy env
113
157
--
114
158
115
159
[#paths]
116
-
== Paths
160
+
== Sub-Document Paths
117
161
118
162
One of the main differences between JSON and flat rows is that JSON supports a nested structure, allowing documents to contain other documents, also known as sub-documents.
119
-
{sqlpp} provides [.term]_paths_ to support nested data.
163
+
{sqlpp} provides [dfn]#sub-document paths# to support nested data.
120
164
Paths use dot notation syntax to identify the logical location of an attribute within a document.
121
165
For example, to get the street from a customer order, use the path `orders.billTo.street`.
122
166
This path refers to the value for `street` in the `billTo` object.
@@ -160,13 +204,13 @@ the Query tab.
160
204
For more information and examples, refer to xref:n1ql:n1ql-manage/query-settings.adoc#section_srh_tlm_n1b[Named Parameters and Positional Parameters].
161
205
162
206
[#prepare-stmts]
163
-
== Query Optimization Using Prepared Statements
207
+
== Prepared Statements
164
208
165
209
When a {sqlpp} query is sent to the server, the server inspects the query and parses it, planning which indexes to use, if any.
166
-
Once this is done, it generates a _query plan_.
210
+
Once this is done, it generates a [dfn]#query plan#.
167
211
The computation for the plan adds some additional processing time and overhead for the query.
168
212
169
-
A frequently-used query can be _prepared_ so that its plan is generated only once.
213
+
You can [dfn]#prepare# a frequently-used query so that its plan is generated only once.
170
214
Subsequent queries using the same query will use the pre-generated plan instead, saving on the overhead and processing of the plan each time.
171
215
172
216
NOTE: Parameterized queries are considered the same query for caching and planning purposes, even if the supplied parameters are different.
@@ -181,10 +225,10 @@ This allows specific data (for example, specific fields) to be retrieved quickly
181
225
182
226
The Index service enables you to create two types of index: primary indexes and global secondary indexes.
183
227
184
-
* You can define a _primary index_ on a keyspace.
228
+
* You can define a [dfn]#primary index# on a keyspace.
185
229
Primary indexes are based on the unique key of every item in a specified collection. A primary index is intended to be used for simple queries, which have no filters or predicates.
186
230
187
-
* You can also create a _secondary index_ on specific fields in a keyspace.
231
+
* You can also create a [dfn]#secondary index# on specific fields in a keyspace.
188
232
Secondary indexes, often referred to as Global Secondary Indexes or GSIs, constitute the principal means of indexing documents to be accessed by the Query service.
189
233
+
190
234
For example, creating a secondary index on the `name` and `email` fields in the `users` keyspace would allow you to query the keyspace regarding a document's `name` or `email` properties.
0 commit comments