From cdce6af5a45344324b91b838357c36ca3b9c5f8f Mon Sep 17 00:00:00 2001 From: Christian Himpe Date: Mon, 6 Jan 2025 09:22:02 +0100 Subject: [PATCH 1/9] Add bluesky link --- src/main/asciidoc/appendix/community.adoc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/asciidoc/appendix/community.adoc b/src/main/asciidoc/appendix/community.adoc index 521bea6c..c7b4c9bc 100644 --- a/src/main/asciidoc/appendix/community.adoc +++ b/src/main/asciidoc/appendix/community.adoc @@ -5,6 +5,7 @@ Join our growing community around the world, for ideas, discussions and help reg - Chat live with us on Discord: https://discord.gg/w2Npx2B7hZ - Follow us on Twitter: https://twitter.com/arcade_db +- or on Bluesky: https://bsky.app/profile/arcadedb.bsky.social - Connect with us on LinkedIn: https://www.linkedin.com/products/arcadedb - or on Facebook: https://www.facebook.com/arcadedb - Questions tagged `#arcadedb` on Stack Overflow: https://stackoverflow.com/questions/tagged/arcadedb From a3c013d1ea79f2ba58281109a645247f00441f39 Mon Sep 17 00:00:00 2001 From: Christian Himpe Date: Mon, 6 Jan 2025 09:22:16 +0100 Subject: [PATCH 2/9] Fix typo --- src/main/asciidoc/sql/SQL-Projections.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/asciidoc/sql/SQL-Projections.adoc b/src/main/asciidoc/sql/SQL-Projections.adoc index 64ecc653..1499160b 100644 --- a/src/main/asciidoc/sql/SQL-Projections.adoc +++ b/src/main/asciidoc/sql/SQL-Projections.adoc @@ -25,7 +25,7 @@ has three projections: ==== Syntax -*A projection* has the following syntax: +A *projection* has the following syntax: `<expression> [<nestedProjection>] [ AS <alias> ]` From 9956d3d36274fcb97646cee402a771c9c6fe4b01 Mon Sep 17 00:00:00 2001 From: Christian Himpe Date: Mon, 6 Jan 2025 09:22:50 +0100 Subject: [PATCH 3/9] Add console -fae switch info --- src/main/asciidoc/tools/console.adoc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/asciidoc/tools/console.adoc b/src/main/asciidoc/tools/console.adoc index 4cbd7939..9a41173c 100644 --- a/src/main/asciidoc/tools/console.adoc +++ b/src/main/asciidoc/tools/console.adoc @@ -18,6 +18,7 @@ The following command-line arguments are supported by the console: * `-D` allows to pass <<#Settings,settings>>, * `-b` enables batch mode which exits after executing all commands passed via the command-lines. +* `-fae` fail-at-end if error occurs during batch (normally batch mode breaks execution at an error). The console supports these direct commands (not evaluated by the query engine): From 6f977263cc10769a815a3035b3d3948c7b217da6 Mon Sep 17 00:00:00 2001 From: Christian Himpe Date: Mon, 6 Jan 2025 10:17:29 +0100 Subject: [PATCH 4/9] Add note on index use of LIKE --- src/main/asciidoc/sql/SQL-Where.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/asciidoc/sql/SQL-Where.adoc b/src/main/asciidoc/sql/SQL-Where.adoc index 7aa80690..554969ee 100644 --- a/src/main/asciidoc/sql/SQL-Where.adoc +++ b/src/main/asciidoc/sql/SQL-Where.adoc @@ -59,7 +59,7 @@ And `item` can be: |Apply to|Operator|Description|Example |any|`+=+` or `+==+`|Equals|`+name = 'Luke'+` |any|`+<=>+`|Null-safe-equals, is also true if left and right operands are `+NULL+`|`+name <=> word+` -|string|`+LIKE+`|Similar to equals, but allows the wildcards '`+%+`' that means "any characters" and '`+?+`' that means "any single character". `+LIKE+` is case sensitive.|`+name LIKE 'Luk%'+` +|string|`+LIKE+`|Similar to equals, but allows the wildcards '`+%+`' that means "any characters" and '`+?+`' that means "any single character". `+LIKE+` is case sensitive. Does not index!|`+name LIKE 'Luk%'+` |string|`+ILIKE+`|Similar to `+LIKE+`, but `+ILIKE+` is case insensitive.|`+name ILIKE 'lUk%'+` |any|`+<+`|Less than|`+age < 40+` |any|`+<=+`|Less or equal to|`+age <= 40+` From ac99221310f8a8f4bb76fe735b8e77aff508a177 Mon Sep 17 00:00:00 2001 From: Christian Himpe Date: Mon, 6 Jan 2025 11:43:34 +0100 Subject: [PATCH 5/9] describe projections with and without star more precisely --- src/main/asciidoc/sql/SQL-Introduction.adoc | 14 +++++++------- src/main/asciidoc/sql/SQL-Projections.adoc | 5 ++--- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/main/asciidoc/sql/SQL-Introduction.adoc b/src/main/asciidoc/sql/SQL-Introduction.adoc index 7244657d..eec89f41 100644 --- a/src/main/asciidoc/sql/SQL-Introduction.adoc +++ b/src/main/asciidoc/sql/SQL-Introduction.adoc @@ -18,8 +18,8 @@ For example, if you have a type `MyType` with a field named `id`, then the follo [source,sql] ---- -SELECT FROM MyType WHERE id = 1 -select from MyType where id = 1 +SELECT * FROM MyType WHERE id = 1 +select * from MyType where id = 1 ---- @@ -27,7 +27,7 @@ The following is NOT equivalent. Notice that the field name 'ID' is not the same [source,sql] ---- -SELECT FROM MyType WHERE ID = 1 +SELECT * FROM MyType WHERE ID = 1 ---- @@ -35,7 +35,7 @@ Also the following query is NOT equivalent because of the type 'mytype ' is not [source,sql] ---- -SELECT FROM mytype WHERE id = 1 +SELECT * FROM mytype WHERE id = 1 ---- @@ -47,7 +47,7 @@ Example: [source,sql] ---- -SELECT FROM INDEX:myIndex WHERE key = 'Jay' +SELECT * FROM INDEX:myIndex WHERE key = 'Jay' ---- *Extra resources* @@ -182,14 +182,14 @@ projection is optional. Example: In SQL to select all of the columns of Customer SELECT * FROM Customer ---- -In ArcadeDB, the `*` is optional: +In ArcadeDB, the `*` may be omitted: [source,sql] ---- SELECT FROM Customer ---- -See <>. +The result is similar, for details see <<_query-results_,Query Results>>. *System Types* diff --git a/src/main/asciidoc/sql/SQL-Projections.adoc b/src/main/asciidoc/sql/SQL-Projections.adoc index 1499160b..9923927e 100644 --- a/src/main/asciidoc/sql/SQL-Projections.adoc +++ b/src/main/asciidoc/sql/SQL-Projections.adoc @@ -39,14 +39,13 @@ A projection block has the following syntax: * `DISTINCT`: removes duplicates from the result-set [discrete] - ==== Query result By default, a query returns a different result-set based on the projections it has: -* `+*+` *alone*: The result set is made of records as they arrive from the target, with the original `@rid` and `@type` attributes (if any) +* *no projections*: The result set is made of records as they arrive from the target, with the original `@rid` and `@type` attributes (if any) +* `+*+` *alone*: same behavior as without `+*+` except the `hidden` property attribute is applied. * `+*+` *plus other projections*: records of the original target, merged with the other projection values, with `@rid` and `@type` of the original record. -* *no projections*: same behavior as `*` * `expand(<projection>)`: The result set is made of the records returned by the projection, expanded (if the projection result is a link or a collection of links) and unwinded (if the projection result is a collection). Nothing in all the other cases. * *one or more projections*: temporary records (with temporary `@rid` and no `@type`). Projections that represent links are returned as simple @rid values, unless differently specified in the fetch plan. From 6d1e7748e8888bd3740d12582f8650316d1d6850 Mon Sep 17 00:00:00 2001 From: Christian Himpe Date: Fri, 10 Jan 2025 10:00:24 +0100 Subject: [PATCH 6/9] fix typo --- src/main/asciidoc/api/java-vectors.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/asciidoc/api/java-vectors.adoc b/src/main/asciidoc/api/java-vectors.adoc index ae2fa938..9f861937 100644 --- a/src/main/asciidoc/api/java-vectors.adoc +++ b/src/main/asciidoc/api/java-vectors.adoc @@ -4,7 +4,7 @@ image:../images/edit.png[link="https://github.com/ArcadeData/arcadedb-docs/blob/ Using the Embedded Java API is the fastest way to insert vector embeddings into the database. At the beginning it's much faster to pass through the `HnswVectorIndexRAM` implementation and then generate the persistent index after loaded. -Schema types are created automatically, but you could create them in advance if you want special settings, like a specific numbe rof buckets, or a custom page size. +Schema types are created automatically, but you could create them in advance if you want special settings, like a specific number of buckets, or a custom page size. Example of inserting embeddings in RAM first, and then create the persistent HNSW index. From dcde6a0f6f5e943a004043ab925a58bc9a8df4d7 Mon Sep 17 00:00:00 2001 From: Christian Himpe Date: Fri, 10 Jan 2025 10:00:55 +0100 Subject: [PATCH 7/9] add note for safe type dropping to DROP TYPE command --- src/main/asciidoc/sql/SQL-Drop-Type.adoc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/asciidoc/sql/SQL-Drop-Type.adoc b/src/main/asciidoc/sql/SQL-Drop-Type.adoc index 9e25a820..f0057bc2 100644 --- a/src/main/asciidoc/sql/SQL-Drop-Type.adoc +++ b/src/main/asciidoc/sql/SQL-Drop-Type.adoc @@ -6,6 +6,7 @@ image:../images/edit.png[link="https://github.com/ArcadeData/arcadedb-docs/blob/main/src/main/asciidoc/sql/SQL-Drop-Type.adoc" float=right] Removes a type from the schema. +To drop a type (safely), first, all its instances need to be removed. *Syntax* From 73306dae1c30c2371e8edef64253be7366949c9b Mon Sep 17 00:00:00 2001 From: Christian Himpe Date: Fri, 10 Jan 2025 10:01:26 +0100 Subject: [PATCH 8/9] default number of buckets per type is one --- src/main/asciidoc/appendix/settings.adoc | 2 +- src/main/asciidoc/concepts/basics.adoc | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/asciidoc/appendix/settings.adoc b/src/main/asciidoc/appendix/settings.adoc index 916fa35b..be1ff1b3 100644 --- a/src/main/asciidoc/appendix/settings.adoc +++ b/src/main/asciidoc/appendix/settings.adoc @@ -181,7 +181,7 @@ If you're embedding a server in your Java application you can use these settings |`txRetries`|Number of retries in case of MVCC exception|Integer|3 |`txWAL`|Uses the WAL|Boolean|true |`txWalFlush`|Flushes the WAL on disk at commit time. It can be 0 = no flush, 1 = flush without metadata and 2 = full flush (fsync)|Integer|0 -|`typeDefaultBuckets`|Default number of buckets to create per type|Integer|8 +|`typeDefaultBuckets`|Default number of buckets to create per type|Integer|1 |=== ===== Available Plugins diff --git a/src/main/asciidoc/concepts/basics.adoc b/src/main/asciidoc/concepts/basics.adoc index 8e0994a5..f738eb19 100644 --- a/src/main/asciidoc/concepts/basics.adoc +++ b/src/main/asciidoc/concepts/basics.adoc @@ -127,7 +127,8 @@ Also, <> have their separate buckets from their super-typ When you create a new type, the <> statement automatically creates the physical buckets (files) that serve as the default location in which to store data for that type. ArcadeDB forms the bucket names by using the type name + underscore + a sequential number starting from 0. For example, the first bucket for the type `Beer` will be `Beer_0` and the correspondent file in the file system will be `Beer_0.31.65536.bucket`. -ArcadeDB creates additional buckets for each type, (one for each CPU core on the server), to improve performance of parallelism. +By default ArcadeDB creates one bucket per type. +For massive inserts, performance can be improved by creating additional buckets and hence taking advantage of parallelism, i.e. by creating one bucket for each CPU core on the server. [discrete] ==== Types vs. Buckets in Queries From 0538808379df00c82894c68c0fae03e3aad01e4a Mon Sep 17 00:00:00 2001 From: Christian Himpe Date: Fri, 10 Jan 2025 10:47:23 +0100 Subject: [PATCH 9/9] fix typo --- src/main/asciidoc/sql/SQL-Where.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/asciidoc/sql/SQL-Where.adoc b/src/main/asciidoc/sql/SQL-Where.adoc index 554969ee..24077f43 100644 --- a/src/main/asciidoc/sql/SQL-Where.adoc +++ b/src/main/asciidoc/sql/SQL-Where.adoc @@ -59,7 +59,7 @@ And `item` can be: |Apply to|Operator|Description|Example |any|`+=+` or `+==+`|Equals|`+name = 'Luke'+` |any|`+<=>+`|Null-safe-equals, is also true if left and right operands are `+NULL+`|`+name <=> word+` -|string|`+LIKE+`|Similar to equals, but allows the wildcards '`+%+`' that means "any characters" and '`+?+`' that means "any single character". `+LIKE+` is case sensitive. Does not index!|`+name LIKE 'Luk%'+` +|string|`+LIKE+`|Similar to equals, but allows the wildcards '`+%+`' that means "any characters" and '`+?+`' that means "any single character". `+LIKE+` is case sensitive. Does not use index!|`+name LIKE 'Luk%'+` |string|`+ILIKE+`|Similar to `+LIKE+`, but `+ILIKE+` is case insensitive.|`+name ILIKE 'lUk%'+` |any|`+<+`|Less than|`+age < 40+` |any|`+<=+`|Less or equal to|`+age <= 40+`