Skip to content

Commit

Permalink
Documentation clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
tywalch committed Oct 18, 2024
1 parent 65792c8 commit 5f35339
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
4 changes: 2 additions & 2 deletions www/src/pages/en/modeling/indexes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -272,14 +272,14 @@ This option changes how ElectroDB formats your keys for storage, so it is an imp
By default, and when omitted, ElectroDB will create your index as an `isolated` index. Isolated indexes optimizes your index structure for faster and more efficient retrieval of items within an individual Entity.

_Choose_ `isolated` if you have strong access pattern requirements to retrieve only records for only your entity on that index. While an `isolated` index is more limited in its ability to be used in a [collection](/en/modeling/collections), it can perform better than a `clustered` index if a collection contains a highly unequal distribution of entities within a collection.
_Don't choose_ `isolated` if the primary use-cases for your index is to query across entities -- this index type does limit the extent to which indexes can be leveraged to improve query efficiency.
_Do not choose_ `isolated` if the primary use-cases for your index is to query across entities -- this index type does limit the extent to which indexes can be leveraged to improve query efficiency.

### Clustered Indexes

When your index type is defined as `clustered`, ElectroDB will optimize your index for relationships within a partition. Clustered indexes optimize your index structure for more homogenous partitions, which allows for more efficient queries across multiple entities.

_Choose_ `clustered` if you have a high degree of grouped or similar data that needs to be frequently accessed together. This index works best in [collections](/en/modeling/collections) when member entities are more evenly distributed within a partition.
_Don't choose_ `clustered` if your need to query across entities is secondary to its primary purpose -- this index type limits the efficiency of querying your individual entity.
_Do not choose_ `clustered` if your need to query across entities is secondary to its primary purpose -- this index type limits the efficiency of querying your individual entity.

### Isolated vs Clustered

Expand Down
2 changes: 1 addition & 1 deletion www/src/pages/en/recipes/keys-only-gsi.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ If you do not wish to "hydrate" your query response, you still have ways you can
### Include Keys

The query execution options `{ ignoreOwnership: true, data: 'includeKeys' }` allow you to return keys on the `data` array. The option `ignoreOwnership` is also used here to limit filters applied to query. ElectroDB filters items that it cannot identify as belonging to an Entity; `KEYS_ONLY` items are then indistinguishable from unidentifiable items.
The query execution options `{ ignoreOwnership: true, data: 'includeKeys' }` allow you to return keys on the `data` array. The option `ignoreOwnership` is also used here to limit filters applied to query to identify item types. ElectroDB filters out items that it cannot identify as belonging to an Entity using identifier attributes (`__edb_e__`, and `__edb_v__`); `KEYS_ONLY` items are then indistinguishable from unidentifiable items.

```typescript
// The elements in the `data` array are just the keys of the index, despite the typing saying otherwise.
Expand Down
4 changes: 1 addition & 3 deletions www/src/partials/query-options.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,7 @@ By default, **ElectroDB** interrogates items returned from a query for the prese

### limit
**Default Value:** _none_
Used a convenience wrapper for the DynamoDB parameter `Limit` [[read more](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Query.html#DDB-Query-request-Limit)]. When `limit` is paired option `pages:"all"`, ElectroDB will paginate DynamoDB until the limit is _at least_ reached or all items for that query have been returned; this means you may receive _more_ items than your specified `limit` but never less.

> Note: If your use case requires returning a specific number of items at a time, the `count` option is the better option.
Used a convenience wrapper for the DynamoDB parameter `Limit` [[read more](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Query.html#DDB-Query-request-Limit)].

### count
**Default Value:** _none_
Expand Down

0 comments on commit 5f35339

Please sign in to comment.