Skip to content

Commit 516cf89

Browse files
authored
Merge pull request #345 from gramian/main
add list indexing to CREATE INDEX sql ref entry
2 parents a991788 + bbcf09d commit 516cf89

File tree

9 files changed

+44
-10
lines changed

9 files changed

+44
-10
lines changed

src/main/asciidoc/administration-guide/backup.adoc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ You can execute the backup of a database from SQL.
77

88
Look at <<sql-backup-database,Backup Database SQL command>> for more information.
99

10+
==== Configuration
11+
12+
- `-f <backup-file>` (string) filename of, or path to the backup file to create.
13+
- `-d <database-path>` (string) path on local filesystem where to find the ArcadeDB database.
14+
- `-o` (boolean) true to overwrite the backup if already exists.
15+
If false and the `backup-path` already exists, an error is thrown.
16+
Default is false.
17+
1018
==== Cloud Backups
1119

1220
In a container setting it may become necessary to send backups to an S3 bucket instead of a mounted volume.

src/main/asciidoc/api-reference/chapter.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ You can use any programming language that supports HTTP calls (pretty much any l
1010
| Java | Bundled with the project. Look at `Remote Database` class | Apache 2
1111
| CHICKEN Scheme | http://wiki.call-cc.org/eggref/5/arcadedb | zlib-acknowledgement
1212
| .NET | https://github.com/tetious/ArcadeDb.Client | Apache 2
13-
// | PHP (Laravel) | https://github.com/skcheung/laravel-arcadedb | ?
14-
// | Python | https://github.com/adaros92/arcadedb-python-driver | Apache 2
13+
| PHP (Laravel) | https://github.com/skcheung/laravel-arcadedb | ?
14+
| Python | https://github.com/adaros92/arcadedb-python-driver | Apache 2
1515
| Python | https://github.com/ExtReMLapin/pyarcade | Apache 2
1616
| Python | https://github.com/stevereiner/arcadedb-python | Apache 2
1717
| Ruby | https://github.com/topofocus/arcadedb | MIT

src/main/asciidoc/api-reference/python.adoc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
=== Python
33
image:../images/edit.png[link="https://github.com/ArcadeData/arcadedb-docs/blob/main/src/main/asciidoc/api-reference/python.adoc" float=right]
44

5-
Work in progress
5+
// Besides the Python <<api-reference,drivers>> there are direct bindings for Python available.
6+
// For details see https://github.com/arcadedata/arcadedb/blob/embedded-python/bindings/python/README.md .
67

7-
// Use of `stubgenj` https://pypi.org/project/stubgenj/
8+
Work in progress

src/main/asciidoc/core-concepts/indexes.adoc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,19 @@ B+Tree is the most common algorithm used by relational DBMSs. What are the diffe
3838
5. However, there are also some potential disadvantages of LSM tree compared to B+ tree. For example, B+ tree may be faster for queries that require range scans or random access, and it may be easier to implement in some cases.
3939

4040
If you're interested to ArcadeDB's LSM-Tree index implementation detail, look at <<lsm-tree,LSM-Tree>>
41+
42+
==== Index Property Types
43+
44+
ArcadeDB's LSM Tree Indexes can index property fields in various ways:
45+
46+
1. All properties (scalar or collections) can be indexed in a unique or non-unique index (as a whole).
47+
48+
2. An index can be for a single property, or multiple properties in a compund index.
49+
50+
3. String properties can be index tokenized in a full-text index.
51+
52+
4. Object properties can be indexed by keys or by values.
53+
54+
5. List properties can be indexed by values.
55+
56+
6. Vectors of floats can be indexed using a special vector index.

src/main/asciidoc/query-languages/sql/sql-create-index.adoc

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ ____
2424
----
2525
CREATE INDEX [<manual-index-name>]
2626
[ IF NOT EXISTS ]
27-
[ ON <type> (<property> [BY KEY|VALUE][,]*) ]
27+
[ ON <type> (<property> [BY KEY|VALUE|ITEM][,]*) ]
2828
<index-type> [<key-type>]
2929
[ NULL_STRATEGY SKIP|ERROR]
3030
@@ -40,6 +40,7 @@ The type must already exist.
4040
The property must already exist.
4141
** `BY KEY` index by key names for map properties.
4242
** `BY VALUE` index by values for map properties.
43+
** `BY ITEM` index by values for list elements.
4344
* *`&lt;index-type&gt;`* Defines the index type you want to use:
4445
** `UNIQUE` does not allow duplicate keys,
4546
** `NOTUNIQUE` allows duplicate keys,
@@ -58,7 +59,7 @@ If the property types don't equal those specified in the key type list, it throw
5859

5960
NOTE: Null values are not indexed, so any query that is looking for null values will not use the index with a full scan.
6061

61-
NOTE: A unique index does not regard or derived types or embedded documents of the indexed type.
62+
NOTE: A unique index does not regard derived types or embedded documents of the indexed type.
6263

6364
NOTE: Full-text indexes do not support multiple properties.
6465

@@ -85,6 +86,12 @@ ArcadeDB> CREATE INDEX ON Movie (thumbs BY KEY) UNIQUE
8586
ArcadeDB> CREATE INDEX ON Movie (thumbs BY VALUE) UNIQUE
8687
----
8788

89+
* Create a index for the `actors` list property in the type `Movie`:
90+
91+
----
92+
ArcadeDB> CREATE INDEX ON Movie (actors BY ITEM) NOTUNIQUE
93+
----
94+
8895
* Create a series of properties and on them create a composite index:
8996

9097
----

src/main/asciidoc/query-languages/sql/sql-custom-functions.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ Before to use them in your queries you need to register:
7272

7373
[source,java]
7474
----
75+
SQLQueryEngine sqlEngine = (SQLQueryEngine) database.getQueryEngine("sql");
76+
7577
// REGISTER 'BIGGER' FUNCTION WITH FIXED 2 PARAMETERS (MIN/MAX=2)
7678
SQLEngine.getInstance().registerFunction("bigger",
7779
new SQLFunctionAbstract("bigger", 2, 2) {

src/main/asciidoc/query-languages/sql/sql-import-database.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,4 @@ IMPORT DATABASE http://echo.jsontest.com/key/value/one/two WITH probeOnly = true
6060
IMPORT DATABASE file://empty.csv WITH vertices="file://vertices.csv", verticesFileType=csv, typeIdProperty=Id, typeIdType=Long, edges="file://edges.csv", edgesFileType=csv, edgeFromField="From", edgeToField="To"
6161
----
6262

63-
See also <<importer,Importer>>
63+
See also <<importer,Importer>> for a description of the settings.

src/main/asciidoc/query-languages/sql/sql-where.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ And `item` can be:
7777
|map|`+CONTAINSKEY+`|true if the map contains at least one key equals to the requested. You can also use `+map.keys() CONTAINS+` in place of it|`+connections CONTAINSKEY 'Luke'+`
7878
|map|`+CONTAINSVALUE+`|true if the map contains at least one value equals to the requested. You can also use `+map.values() CONTAINS+` in place of it|`+connections CONTAINSVALUE 10:3+`
7979
|string|`+CONTAINSTEXT+`| When used against an indexed field, a lookup in the index will be performed with the text specified as key. When there is no index a simple Java `+indexOf+` will be performed. So the result set could be different if you have an index or not on that field |`+text CONTAINSTEXT 'jay'+`
80-
|string|`+MATCHES+`|Matches the string using a http://www.regular-expressions.info/[Regular Expression]. Use the modifier `(?s)` to make `.` match also newlines.|`pass:[text MATCHES `\b[A-Z0-9.%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b`]`
80+
|string|`+MATCHES+`|Matches the string using a http://www.regular-expressions.info/[Regular Expression]. Use the modifier `(?s)` to make `.` match also newlines, and `(?i)` for case insensitive patterns.|`pass:[text MATCHES `\b[A-Z0-9.%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b`]`
8181
|===
8282

8383
[discrete]

src/main/asciidoc/reference/settings.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Here is an example to increase the default page size for buckets to 1 MB:
5454
ALTER DATABASE `arcadedb.bucketDefaultPageSize` 1048576
5555
```
5656

57-
The current settings can be listed form SQL using:
57+
The current settings can be listed from SQL using:
5858

5959
```sql
6060
SELECT expand(settings) FROM schema:database
@@ -181,7 +181,7 @@ The following plugins are available for ArcadeDB Server:
181181
|`asyncTxBatchSize`|Maximum number of operations to commit in batch by async thread|Integer|10240
182182
|`asyncWorkerThreads`|Number of asynchronous worker threads. By default it is cores minus 1, but at least 1|Integer|(machine dependent)
183183
|`bucketDefaultPageSize`|Default page size in bytes for buckets. Default is 65536|Integer|65536
184-
|`arcadedb.bucketReuseSpaceMode`|Mode used to reuse space in pages. Use 'low' to have faster updates consuming more space on disk, `medium` for balance. Default is 'high'|String|high
184+
|`bucketReuseSpaceMode`|Mode used to reuse space in pages. Use 'low' to have faster updates consuming more space on disk, `medium` for balance. Default is 'high'|String|high
185185
|`bucketWipeOutOnDelete`|Wipe out record content on delete. If enabled, assures deleted records cannot be analyzed by parsing the raw files and backups will be more compressed, but it also makes deletes a little bit slower|Boolean|true
186186
|`command.timeout`|Default timeout for commands (in ms)|Long|0
187187
|`command.warningsEvery`|Reduce warnings in commands to print in console only every X occurrences. Use 0 to disable warnings with commands|Integer|100

0 commit comments

Comments
 (0)