Batch size in query Entity

Hello,

We are facing a wired issue. We are having a query entity with selection only, when we test it with batch size 50 it takes more time as compared when we use it with -1 batch size. Can anyone explain why? and how batch size query.

 

Thanks & Regards

Sahil Batra

  Discussion posts and replies are publicly visible

Parents
  • When adding a batch size other than -1, Appian converts this to a LIMIT clause when executing the query.  Since the LIMIT clause takes some time to execute, for smaller datasets, this can take longer than executing the same query without the LIMIT Clause. 

    For example, using batchSize of 50, the query might look like:

    SELECT
        ID
    FROM ORDER
    LIMIT 50;

    And with a batchSize of -1, it would be:

    SELECT
        ID
    FROM ORDER

     

    Obviously this won't hold true as your dataset grows, but for queries that only return a small number of rows, sometimes -1 is faster.

Reply
  • When adding a batch size other than -1, Appian converts this to a LIMIT clause when executing the query.  Since the LIMIT clause takes some time to execute, for smaller datasets, this can take longer than executing the same query without the LIMIT Clause. 

    For example, using batchSize of 50, the query might look like:

    SELECT
        ID
    FROM ORDER
    LIMIT 50;

    And with a batchSize of -1, it would be:

    SELECT
        ID
    FROM ORDER

     

    Obviously this won't hold true as your dataset grows, but for queries that only return a small number of rows, sometimes -1 is faster.

Children