Creating Query Partitions
When creating a query partition, you specify the query partition name, number, and the number of forests to be created for the query partition. You can also specify that the query partition be created for multiple hosts in a cluster, in which case the specified number of forests will be created on each host.
Query partitions are based on forest naming conventions. A forest’s partition name prefix and the rest of the forest name are separated by a dash (-). For example, a forest named tier1-0001
belongs to the tier1
partition. Unlike range partitions, it is not necessary for all of the forests in a database configured for tiered storage to be part of a query partition.
Note
It is a best practice to create a default query partition (a partition without a query). Doing this will allow you to load documents into the default partition before you have finished creating the other partitions. As new partitions with queries are created, the documents will be automatically moved from the default partition to the query partitions with matching queries.
For details on how to configure the database rebalancer with the query assignment policy, see the sections Query Assignment Policy, Configuring the Rebalancer on a Database, and Configuring the Rebalancer on a Forest.
Query partitions do unfiltered searches, which means that the results are not filtered for validation. For details about unfiltered queries, see the Fast Pagination and Unfiltered Searches in the Query Performance and Tuning Guide.
For example, the following command creates query partition number 1
, named tier1
, with two forests in the Documents
database on the host, MyHost1
:
curl -X POST --anyauth --user admin:admin \ -H "Content-type: application/json" \ -d '{ "partition-name": "tier1", "partition-number": "1", "forests-per-host": 2, "host": [ "MyHost1" ], "option": [ "failover=none" ] }' \ http://MyHost1:8002/manage/v2/databases/Documents/partitions