How Many Range Indexes?
09 November 2021 05:12 PM
The target for range indexes in a MarkLogic database should be about 100. This is because:
- In the interests of performance, MarkLogic Server indexes your content on ingest, then memory maps those indexes to serialized data structures on disk. Each of those memory maps requires some amount of RAM.
- If you've got many thousands of indexes you may run into a situation where system monitoring is reporting you've got RAM to spare, but MarkLogic Server is reporting "SVC-MAPINI: Mapped file initialization error." In which case you're likely running up against Linux's default vm.max_map_count value.
- Independent of SVC-MAPINI errors, the more range indexes you've configured, the longer it will take to perform forest operations.
- If you find yourself configuring many hundreds or even thousands of range indexes, you should migrate your data modeling scheme to take advantage of Template Driven Extraction (TDE), which was specifically engineered to address this scenario.