Skip to content

Commit 2ba222e

Browse files
authored
Link to array functions from concepts (#212)
1 parent dc98835 commit 2ba222e

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

documentation/concept/array.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,18 @@ an array whose shape hasn't been transformed (that is, it matches the physical
9292
arrangement of elements) is a _vanilla_ array, and this has consequences for
9393
performance. A vanilla array can be processed by optimized bulk operations that
9494
go over the entire block of memory, disregarding the shape and strides, whereas
95-
for any other array we have to step through all the coordinates one by one and
95+
for most other arrays we have to step through all the coordinates one by one and
9696
calculate the position of each element.
9797

98-
So, while performing a shape transformation is cheap on its own, whole-array
99-
operations on transformed arrays, such as equality checks, adding/multiplying
100-
two arrays, etc., are expected to be faster on vanilla arrays.
98+
There's a special case where the array is transformed just so that the new array
99+
can be found in vanilla shape within the memory block of the original array (a
100+
contiguous sub-array). Such a transformed array is also considered vanilla.
101+
Major examples are slicing the array at the top (leftmost) dimension, and taking
102+
a sub-array at the top dimension.
103+
104+
While performing a shape transformation is cheap on its own, whole-array
105+
operations, such as equality checks, adding/multiplying two arrays, etc., are
106+
expected to be faster on vanilla arrays.
101107

102108
QuestDB always stores arrays in vanilla form. If you transform an array's shape
103109
and then store it to the database, QuestDB will physically rearrange the
@@ -130,6 +136,12 @@ SELECT ARRAY[arr, brr] FROM tango;
130136
| --------------------- |
131137
| [[1.0,2.0],[3.0,4.0]] |
132138

139+
## Array functions
140+
141+
Functions that operate on arrays are documented on a
142+
[dedicated page](/docs/reference/function/array). There are also some
143+
[financial functions](/docs/reference/function/finance#l2price) that operate on arrays.
144+
133145
## Array access syntax
134146

135147
We model our N-dimensional array access syntax on Python's `NDArray`, except that

0 commit comments

Comments
 (0)