June 2018
Intermediate to advanced
460 pages
12h 59m
English
Performing queries on large datasets is a computationally complex task. Fabric provides a mechanism for defining indexes on the CouchDB hosted Worldstate to increase efficiency. Note that indexes are also required for sorting operations in queries.
An index is defined in JSON in a separate file with the extension *.json. The full definition of the format is available at: http://docs.couchdb.org/en/2.1.1/api/database/find.html#db-index.
The following snippet illustrates an index that matches our query for the trade agreements we looked at earlier:
{
"index": {
"fields": [
"status",
"payment"
]
},
"name": "index_sp",
"type": "json"
}
Here, the index files are placed into the folder /META-INF/statedb/couchdb/indexes. During compilation, ...
Read now
Unlock full access