Skip to content

Commit ee4ce6f

Browse files
aljazerzendnwpark
andauthored
Docs for 7.x features (#9002)
- **docs: permissions** - **docs: SQL COPY** - **docs: Role.branches** - **docs: Index.create_concurrently** --------- Co-authored-by: dnwpark <dnwpark@protonmail.com>
1 parent a32f991 commit ee4ce6f

File tree

6 files changed

+492
-7
lines changed

6 files changed

+492
-7
lines changed

docs/reference/ai/extai.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,8 @@ Example custom prompt configuration:
524524
Permissions
525525
===========
526526

527+
.. _ref_ai_extai_reference_permissions:
528+
527529
.. versionadded:: 7.0
528530

529531
.. list-table::

docs/reference/datamodel/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Schema
2121
aliases
2222
globals
2323
access_policies
24+
permissions
2425
functions
2526
triggers
2627
mutation_rewrites

docs/reference/datamodel/indexes.rst

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,50 @@ Example:
181181
}
182182
183183
184+
.. _ref_datamodel_indexes_concurrent:
185+
186+
Concurrent index building
187+
=========================
188+
189+
When creating an index, the object type will be locked for writes. This means
190+
that until the index is created, all ``insert``, ``update`` and ``delete``
191+
queries will be put on hold.
192+
On types containing many objects, this can span minutes or even hours.
193+
194+
Instead, index building can be deferred from migration application to a later
195+
time. To do this, set ``build_concurrently`` index property to ``true``:
196+
197+
.. code-block:: sdl
198+
199+
type User {
200+
name: str;
201+
index on (.name) {
202+
build_concurrently := true;
203+
};
204+
}
205+
206+
When this schema in applied to an instance, the index will be created, but it
207+
will not yet be active. The migration will not attempt to read any objects to
208+
build the index.
209+
210+
As the last step of :gelcmd:`migration apply` (and :gelcmd:`migrate`), index
211+
will actually be built. During this time, the object type will not be locked
212+
for reads or writes.
213+
214+
This means that migration will lock for significantly less time and allow index
215+
the be created while new writes are applied to the database.
216+
217+
To apply migrations, but not build indexes at all, use
218+
:gelcmd:`migration apply --no-index-build` flag.
219+
This allows index building to be triggered at a later time,
220+
by using :gelcmd:`migration apply` again.
221+
222+
Until the index is created, it will not be used to speed up queries.
223+
224+
For tradeoffs of concurrent index building, refer to
225+
`PostgreSQL documentation <https://www.postgresql.org/docs/current/sql-createindex.html#SQL-CREATEINDEX-CONCURRENTLY>`_.
226+
227+
184228
Annotate an index
185229
=================
186230

@@ -232,6 +276,11 @@ Syntax
232276
Allows setting index :ref:`annotation <ref_eql_sdl_annotations>` to a given
233277
value.
234278

279+
- :sdl:synopsis:`build_concurrently := <bool>`
280+
281+
Allows index to be built
282+
:ref:`after migration is applied <ref_datamodel_indexes_concurrent>`
283+
to the instance.
235284

236285
.. _ref_eql_ddl_indexes:
237286

@@ -269,6 +318,12 @@ Creates a new index for a given object type or link using *index-expr*.
269318
Assign an annotation to this index.
270319
See :eql:stmt:`create annotation` for details.
271320

321+
- :eql:synopsis:`set build_concurrently := <bool>`
322+
323+
Allows index to be built
324+
:ref:`after migration is applied <ref_datamodel_indexes_concurrent>`
325+
to the instance.
326+
272327
Example:
273328

274329
.. code-block:: edgeql

0 commit comments

Comments
 (0)