Enabling multi-threaded queries

Steps to enable multi-threading if excessive writes exist.

Multi-threaded queries are useful for a low-indexing volume with longer running queries.

Multi-threaded queries can offset the load of a query onto the CPU instead of writing and reading to disk. Benchmarking is recommended, multi-threaded queries do not always improve performance.

Use the CQL index management commands to set the number of queryExecutorThreads for the search index config:
  1. Change the number of threads on an existing table:
    ALTER SEARCH INDEX CONFIG ON healthcare.health_data SET config.queryExecutorThreads=4;
  2. To view the pending search index config in XML format, use this CQL shell command:
    DESCRIBE PENDING SEARCH INDEX CONFIG ON healthcare.health_data;
    The results in XML:
    <config>
      ...
    <query>
        <maxBooleanClauses>1024</maxBooleanClauses>
        <filterCache class="solr.SolrFilterCache" highWaterMarkMB="2048" lowWaterMarkMB="1024"/>
        <enableLazyFieldLoading>true</enableLazyFieldLoading>
        <useColdSearcher>true</useColdSearcher>
        <maxWarmingSearchers>16</maxWarmingSearchers>
      ...
    </query>
    ...
        <queryExecutorThreads>4</queryExecutorThreads>
    </config>
      ...
  3. Use the command to apply the pending changes to the search index:
    RELOAD SEARCH INDEX ON healthcare.health_data;
  4. To view the active search index in XML format:
    DESCRIBE ACTIVE SEARCH INDEX CONFIG ON healthcare.health_data;