<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.appian.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>batching the query</title><link>https://community.appian.com/discussions/f/general/9180/batching-the-query</link><description>Hi, I want to know how does exactly batching the query will work in Appian in retrieve the larger data ? OriginalPostID-256157</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: batching the query</title><link>https://community.appian.com/thread/41129?ContentTypeID=1</link><pubDate>Fri, 06 Jan 2017 13:48:28 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ec22bf97-2024-42a5-8b25-e10988df9454</guid><dc:creator>rohandhondilalk401</dc:creator><description>Hi Every one , thanks for the deep explanation !!&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: batching the query</title><link>https://community.appian.com/thread/41113?ContentTypeID=1</link><pubDate>Fri, 06 Jan 2017 08:08:51 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:bef7e8a2-827b-4eae-88ef-c7d7e09c615f</guid><dc:creator>Sally Mason</dc:creator><description>Be mindful that if you increase the default &amp;quot;conf.data.query.timeout&amp;quot; and&amp;quot;query.memory.limit&amp;quot;, you increase the risk of having long running queries that Application Users perceive the Application to be &amp;#39;frozen&amp;#39; or broken... Please look at redesigning or optimizing your query before changing any settings, and note that for Appian Cloud, these settings are locked down/not configurable.&lt;br /&gt;&lt;br /&gt;I&amp;#39;ve seen many cases where people attempt to &amp;quot;solve&amp;quot; the these kind of issues by increasing values.. which is way of compensating for poorly designed queries or exceeding the reasonable limit of how much data can be returned - remember the impact on of the End User experience - its best to optimize what you can and have fast loading Records and Tasks..&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The best and recommended approach is to only bring back what is actually needed - or only what is displayed use batching/pagination to your advantage. If you are finding the database query is very slow/not completing, an alternative approach is to create a &amp;quot;view&amp;quot; at the database level to reduce the returned results. &lt;br /&gt;&lt;br /&gt;For best Appian database practices, please see&lt;br /&gt;&lt;a href="https://forum.appian.com/suite/help/16.3/Database_Performance_Best_Practices.html"&gt;forum.appian.com/.../Database_Performance_Best_Practices.html&lt;/a&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: batching the query</title><link>https://community.appian.com/thread/41086?ContentTypeID=1</link><pubDate>Thu, 05 Jan 2017 20:11:17 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a686ff18-607f-4775-b096-36ca8c2ef3e8</guid><dc:creator>sikhivahans</dc:creator><description>@rohandhondilalk Let's say you would like to retrieve 'x' records at a time. Batch size will be always equal to 'x' and is fixed. Whereas the start index varies across each batch as 1 for the first batch, 1+x for the second batch, 1+(2x) for the third batch, 1+(3x) for the fourth batch and so on. A fixed batch size, a varying start index across each batch, and fn!ceiling(totalCount of query rule or entity/x) number of batches(or iterations) should help you accomplish retrieving the records in batches.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: batching the query</title><link>https://community.appian.com/thread/41070?ContentTypeID=1</link><pubDate>Thu, 05 Jan 2017 14:57:15 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:55b4d37f-26d4-4b52-8e39-fe9c1d24f44b</guid><dc:creator>Rama Thummala</dc:creator><description>@rohandhondilalk,&lt;br /&gt;&lt;br /&gt;Adding to the above, the limit would be based on the size of the memory the records take and time taken to retrieve ,  not based on the number of records we retrieve.&lt;br /&gt;The default value is 10MB and time limit is 10 seconds.&lt;br /&gt;These values can be configured.&lt;br /&gt;conf.data.query.timeout=10  and &lt;br /&gt;conf.data.query.memory.limit=1048576&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: batching the query</title><link>https://community.appian.com/thread/41067?ContentTypeID=1</link><pubDate>Thu, 05 Jan 2017 14:52:52 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:2cf23f31-cd99-4c8b-a196-515b841d6213</guid><dc:creator>Sachin</dc:creator><description>Go through this link if haven&amp;#39;t about batching and data base performance best practices.&lt;br /&gt;&lt;a href="https://forum.appian.com/suite/help/16.3/Database_Performance_Best_Practices.html"&gt;forum.appian.com/.../Database_Performance_Best_Practices.html&lt;/a&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: batching the query</title><link>https://community.appian.com/thread/41066?ContentTypeID=1</link><pubDate>Thu, 05 Jan 2017 14:51:35 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:bf7d2843-3d1b-47b9-bc41-2388fc02f987</guid><dc:creator>rohandhondilalk401</dc:creator><description>Hi Alok, Thanks for the detailed information. But how batching wil help Query rule to fetch data ? Can you explain with an example  if you are ok means?&lt;br /&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: batching the query</title><link>https://community.appian.com/thread/41063?ContentTypeID=1</link><pubDate>Thu, 05 Jan 2017 13:26:20 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:bdb60d38-2ce0-4447-918d-50babce6ea98</guid><dc:creator>aloks0189</dc:creator><description>@rohandhondilalk401 As per my understanding, Appian internally uses JPA in order to perform CRUD operation on DB, when we work with database we may come across though 2 scenarios where we may need to go for Batching&lt;br /&gt;&lt;br /&gt;1. While retrieving large amount of Data: As JPA internally uses JDBC API, so max number of rows for retrieval of data is around 10,000,00 (10 Lakhs, it may exceed if the Row contains less amount of data with respect to column value for each row retrieval), while fetching that large amount of data the time consumption will be more and hence we may get some database related errors, so instead of fetching huge amount of data at a time, we can configure the query to fetch limited set of rows to be retrieve one after another, such requirement we can achieve by using batching&lt;br /&gt;&lt;br /&gt;2. While storing similar kind of set of objects concurrently: here in order to reduce the number of hits on DB, we can add all the similar kind of objects into Batch and can deliver it to database engine, which will take care of inserting the data into the table, in the same order how it was inserted into the batch (While storing an array of objects in Appian)&lt;br /&gt;&lt;br /&gt;=&gt; the major factor in batch is: Batch size &amp; the Total number of rows to be retrieved, where batch size helps to increase the row count, i mean&lt;br /&gt;&lt;br /&gt;if first retrieval at Batch Size 0 is : 1 to 10&lt;br /&gt;then second for Batch Size 1 could be: 11 to 20 and so on&lt;br /&gt;&lt;br /&gt;hope this will help you&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>