<?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>Query Entity taking lot of time in fetching the data.</title><link>https://community.appian.com/discussions/f/rules/11810/query-entity-taking-lot-of-time-in-fetching-the-data</link><description>Hi All, 
 I am using a query entity to fetch the data from microsoft sql. 
 a!queryEntity( entity: cons!ABc, query: { a!query( seletion: { a!querySelection( columns: { column1,column2,column3,column4,column5,column6,column7,column8,column9,column10 }</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Query Entity taking lot of time in fetching the data.</title><link>https://community.appian.com/thread/52437?ContentTypeID=1</link><pubDate>Thu, 08 Feb 2018 16:21:28 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:b02e0319-fa6f-4166-baaa-0072912a873e</guid><dc:creator>chandu</dc:creator><description>Hi Sahilb,&lt;br /&gt;
I suggest the approach given Shyamb. We are also using this type of approach and resulted in good feed back from the business.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Query Entity taking lot of time in fetching the data.</title><link>https://community.appian.com/thread/52429?ContentTypeID=1</link><pubDate>Thu, 08 Feb 2018 13:53:08 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:e8bad84a-c300-441e-84f4-e80e2069b274</guid><dc:creator>Ravi Roshan</dc:creator><description>Hello Sahil,&lt;br /&gt;
&lt;br /&gt;
You can do it by making the database call on the Grid&amp;#39;s saveInto so whenever user will click on the next link it will call the query entity to &lt;br /&gt;
 fetch the data and as you already saving the paginginfo, so it will automatically take the start index as per your requirement.&lt;br /&gt;
&lt;br /&gt;
Case:&lt;br /&gt;
if your batchsize is 10 - &amp;gt; Your query entity rule will return only 10 records&lt;br /&gt;
click on next link - &amp;gt; startindex will become 11, and again your db call get execute and you will get another 10 set of results.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Query Entity taking lot of time in fetching the data.</title><link>https://community.appian.com/thread/52426?ContentTypeID=1</link><pubDate>Thu, 08 Feb 2018 13:00:43 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:51b78187-5dbb-48f0-94ab-d81a77000de2</guid><dc:creator>Shyam Bommakanti</dc:creator><description>Assuming you are trying to display this data on a grid, I suggest default to 25 batchsize. If needed, provide option to toggle between different batchsizes with a dropdown of radio button so that the end user can decide the batchsize but you can still control the max.&lt;br /&gt;
&lt;br /&gt;
Refer to this recipe on how the next page works. Basically saving the paginginfo on gridField makes the grid paginate and batchsize can also be dynamically adjusted: &lt;a href="https://docs.appian.com/suite/help/17.4/recipe_display_data_with_cdt_fields_in_a_grid.html"&gt;docs.appian.com/.../recipe_display_data_with_cdt_fields_in_a_grid.html&lt;/a&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Query Entity taking lot of time in fetching the data.</title><link>https://community.appian.com/thread/52424?ContentTypeID=1</link><pubDate>Thu, 08 Feb 2018 12:43:18 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:60b0edfc-a438-44fc-88b0-70a944901851</guid><dc:creator>sahilb346</dc:creator><description>&lt;a href="/members/coltonb"&gt;Colton Beck&lt;/a&gt; &lt;br /&gt;
Thanks for your reply. It is very  helpful. But what you think then what batch size we should provide. There are 900 minimum rows for a particular user. &lt;br /&gt;
&lt;br /&gt;
Can we give batch size 50 or 100 then when user clicks on the next button then again hit the query and fetch next 100.&lt;br /&gt;
Is this is good approach.&lt;br /&gt;
&lt;br /&gt;
Thanks in Advance&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Query Entity taking lot of time in fetching the data.</title><link>https://community.appian.com/thread/52166?ContentTypeID=1</link><pubDate>Thu, 01 Feb 2018 13:22:16 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:66f96f28-cec0-43e4-be4a-5cc6c45757e9</guid><dc:creator>Colton Beck</dc:creator><description>&lt;p&gt;This is fairly complex logic to handle on the Appian-side. Could you try offboarding some of it to the database in the form of a view that you could query with less complex inputs?&lt;/p&gt;
&lt;p&gt;If&amp;nbsp;it&amp;#39;s not possible to decrease complexity, it may be worthwhile to break this functionality into separate queries. This would not decrease the overall time, but would be less likely to result in a query timeout.&lt;/p&gt;
&lt;p&gt;Also, you&amp;#39;re querying with a -1 batch size, meaning this query will return every row that fits the filter criteria; if there are many rows, I suggest adding more optimal&amp;nbsp;paging logic.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>