Enabling multi-threaded queries

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 RELOAD SEARCH INDEX 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;

Was this helpful?

Give Feedback

How can we improve the documentation?

© 2024 DataStax | Privacy policy | Terms of use

Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Pulsar, Pulsar, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries. Kubernetes is the registered trademark of the Linux Foundation.

General Inquiries: +1 (650) 389-6000, info@datastax.com