Skip to content

Commit

Permalink
NXP-31254: Document file:content/digest and coldstorage:coldContent/d…
Browse files Browse the repository at this point in the history
…igest index
  • Loading branch information
guirenard committed Dec 6, 2022
1 parent 4247ce9 commit fd5f87a
Showing 1 changed file with 20 additions and 13 deletions.
33 changes: 20 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,26 @@ This will build all the modules except _ci_ and generate the correspondent artif

## DB configuration

The Cold Storage addon periodically checks the documents on which a retrieve has been requested. This scan is scheduled [every hour](https://github.com/nuxeo/nuxeo-coldstorage/blob/lts-2021/nuxeo-coldstorage-package/src/main/resources/install/templates/coldstorage/nuxeo.defaults#L7) by default.

This check is done with the following query:
```
SELECT * FROM Document WHERE ecm:mixinType = 'ColdStorage' AND coldstorage:beingRetrieved = 1
```
An index on the `coldstorage:beingRetrieved` property is defined by this [contribution](https://github.com/nuxeo/nuxeo-coldstorage/blob/lts-2021/nuxeo-coldstorage/src/main/resources/OSGI-INF/coldstorage-core-types-contrib.xml#L7) to optimize the execution of this query. However, in case of an existing very large repository where such index creation could take too long, consider creating a partial index prior to starting Nuxeo with the Cold Storage addon installed. For example, on MongoDB:
```
db.default.createIndex(
{ "coldstorage:beingRetrieved": 1 },
{ partialFilterExpression: { "coldstorage:beingRetrieved": true } }
)
```
Create the following db indexes for an optimal functioning of the addon:
- `coldstorage:beingRetrieved`
- `coldstorage:coldContent/digest`
- `file:content/digest`

Typically on MongoDB:
```
db.default.createIndex(
{ "coldstorage:beingRetrieved": 1 },
{ partialFilterExpression: { "coldstorage:beingRetrieved": true } }
);
db.default.createIndex(
{ "file:content/digest": 1 }
);
db.default.createIndex(
{ "coldstorage:coldContent/digest": 1 }
);
```

### Frontend Contribution

Expand Down

0 comments on commit fd5f87a

Please sign in to comment.