<?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>a!queryEntity() timeout</title><link>https://community.appian.com/discussions/f/general/12080/a-queryentity-timeout</link><description>Hello! 
 We encountered a strange issue, one of our queries runs ok from oracle developer but sometimes ago started to fail in Appian. Appian reported it as rule error but in the log there is a timeout. We have it as 30 seconds and from oracle developer</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: a!queryEntity() timeout</title><link>https://community.appian.com/thread/60036?ContentTypeID=1</link><pubDate>Thu, 06 Sep 2018 06:32:38 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:50519754-a441-4acd-89bc-65947340f120</guid><dc:creator>Stefan Helzle</dc:creator><description>Hi there,&lt;br /&gt;
&lt;br /&gt;
queryEntity indeed does two calls to DB. First to get the total number of lines returned and second to get the actual data. But if you use &amp;quot;-1&amp;quot; as batchsize Appian skips the first call and only a single call to DB is needed. We added this to our internal best practices for the cases where the number of returned lines is fixed or very small. Depending on the overhead and network latency of the DB connection this speeds up DB calls quite a bit.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: a!queryEntity() timeout</title><link>https://community.appian.com/thread/60035?ContentTypeID=1</link><pubDate>Thu, 06 Sep 2018 06:24:53 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:4a459c14-e939-4000-a999-e8e81148278b</guid><dc:creator>rajeshs</dc:creator><description>In such case, you can think of re-designing the approach to pull the records from Database utilizing Interface/integration layer of Service. Create a light weight service which will pull the records from Database using PL/QSL based upon input parameters along with paging info (like start index, batchSize) and consume this service from Appian.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: a!queryEntity() timeout</title><link>https://community.appian.com/thread/60003?ContentTypeID=1</link><pubDate>Wed, 05 Sep 2018 15:01:05 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:fb1e63b6-af49-404b-ae8a-d8431105abea</guid><dc:creator>sergeiz</dc:creator><description>Our external data reside nearby on the same Oracle, but it&amp;#39;s external system.&lt;br /&gt;
&lt;br /&gt;
The irony here is that the query that started to fail with timeout recently is a delta pull to our table.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: a!queryEntity() timeout</title><link>https://community.appian.com/thread/59994?ContentTypeID=1</link><pubDate>Wed, 05 Sep 2018 13:21:46 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:97251dcf-8891-40ed-a01f-34e09c1f7124</guid><dc:creator>josep</dc:creator><description>I understand, thinking about external data I always ask the users: &lt;br /&gt;
Do you really need the last data or you can work with a data from 5 minutes ago? 1 hour ago? 1 day ago? &lt;br /&gt;
&lt;br /&gt;
And you can do this by replicating the external data to your oracle database to some kind of staging tables. Or execute que query as sugested in a materialized view.  or use a staging table and try to query to the external resources just the delta. &lt;br /&gt;
If you find a way to sync the deltas that should be faster but requires more reengineering&lt;br /&gt;
&lt;br /&gt;
If they really need real time data Then try to process as much as possible from the database side. stored procedure would be enough but can be resources consuming&lt;br /&gt;
&lt;br /&gt;
Jose&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: a!queryEntity() timeout</title><link>https://community.appian.com/thread/59985?ContentTypeID=1</link><pubDate>Wed, 05 Sep 2018 06:36:27 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:5007fe1c-47e5-4c22-b60e-b2e58fc4930c</guid><dc:creator>sergeiz</dc:creator><description>Hi Jose,&lt;br /&gt;
&lt;br /&gt;
The key problem is the compex data structure that is external and cannot be simplified. This leads Oracle to different execution paths. For instance, one query can return all 10k rows in 15 seconds but the next simpler query goes to minutes.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: a!queryEntity() timeout</title><link>https://community.appian.com/thread/59984?ContentTypeID=1</link><pubDate>Wed, 05 Sep 2018 06:33:17 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:38e9379e-8cc3-4d64-8425-08a7df01ff38</guid><dc:creator>sergeiz</dc:creator><description>Thanks Alok, your list looks quite comprehensive.&lt;br /&gt;
&lt;br /&gt;
I tried all of that apart materialized view that was in my plan.&lt;br /&gt;
&lt;br /&gt;
Unfortunately, our database structure is pretty complex and Oracle sometimes runs the same query with different execution plan and times long.&lt;br /&gt;
&lt;br /&gt;
As data volume would continue to grow I started to think to organize some staging table with all needed data filtered by a stored procedure call without so strict timeout.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: a!queryEntity() timeout</title><link>https://community.appian.com/thread/59981?ContentTypeID=1</link><pubDate>Wed, 05 Sep 2018 06:29:10 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:0640b7ee-1178-4628-b1e5-a7a3a63f78d0</guid><dc:creator>sergeiz</dc:creator><description>Thanks, using stored procedure to some long data preparation looks promising. I&amp;#39;m curios why appian doesn&amp;#39;t have a parameter to skip paging if needed.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: a!queryEntity() timeout</title><link>https://community.appian.com/thread/59976?ContentTypeID=1</link><pubDate>Wed, 05 Sep 2018 04:17:42 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:66ecf474-0884-430a-9d99-48f0a02cfba4</guid><dc:creator>josep</dc:creator><description>Hello Sergeiz, &lt;br /&gt;
&lt;br /&gt;
Multiple thought came to my mind. When you are talking about you are querying a view there are multiple possibilities. &lt;br /&gt;
&lt;br /&gt;
About the view, query and objects: &lt;br /&gt;
&lt;br /&gt;
* I guess your CDT is plain with no nested CDTs? &lt;br /&gt;
* does your query entity has the field selection? If not try that, even you can think about a new CDT&lt;br /&gt;
* another question does he view makes calculations, like formatting the date? Do you have comparatiosn against strings? Can you make competitions against numbers? Or dates which can simplify the where operations? &lt;br /&gt;
* any union in your view? &lt;br /&gt;
* Can you take out some calculations? &lt;br /&gt;
* in the view are you joining too much tables? Can you simplify the view? Can you use left join? &lt;br /&gt;
* Does your tables have proper indexes and primary Keys? If you are joining that is really important&lt;br /&gt;
* if you can reduce the amount of information passed to Appian the better because the transformation fromDB to Appian object takes time. &lt;br /&gt;
* Do you have any special anottations on the cdt for the view ? &lt;br /&gt;
&lt;br /&gt;
Architecture&lt;br /&gt;
*are you on premise ? Or cloud? &lt;br /&gt;
*if on premise the DB is on the same network? above some mentioned latency, that is crucial when comes to complex queries. which application server you have? How is the concurrency and the jdbc pool configuration? &lt;br /&gt;
&lt;br /&gt;
The problem just happens in that view? &lt;br /&gt;
&lt;br /&gt;
Let’s start with this &lt;br /&gt;
&lt;br /&gt;
Jose&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: a!queryEntity() timeout</title><link>https://community.appian.com/thread/59930?ContentTypeID=1</link><pubDate>Tue, 04 Sep 2018 08:32:05 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:78d74ba1-2cf4-43d4-9f55-34a5fa70e4d2</guid><dc:creator>aloks0189</dc:creator><description>&lt;p&gt;Hi &lt;a href="/members/sergeiz"&gt;sergeiz&lt;/a&gt; &amp;nbsp;as per my understanding, you can also consider the following points as mentioned below:&lt;/p&gt;
&lt;p&gt;1. Make the use of Query entity with paging info with less batch size, let&amp;#39;s say between 25 - to -100. &lt;/p&gt;
&lt;p&gt;2. If you are trying to query the View using query entity, then I would recommend switching to materialised view as this will give you much better performance compared to Views.&lt;/p&gt;
&lt;p&gt;3. Try to avoid clumsy manipulations as much as you can , such as multiple filter conditions, aggregations etc..&lt;/p&gt;
&lt;p&gt;4. Try to avoid multiple columns or huge amount of data entry for each row in DB.&lt;/p&gt;
&lt;p&gt;5. If possible, try optimising your expression rule.&lt;/p&gt;
&lt;p&gt;5. Once you are done with above mentioned steps, and still facing the issues, try querying one row and check how much time it&amp;#39;s taking to return the response.&lt;/p&gt;
&lt;p&gt;6. Additionally could you please check with your system administrator about all the engine status and the CPU usage/ utilisation of the server where your Appian instances are running, because sometime due to some other application/ root cause you might be facing the issues,as you said, it&amp;#39;s stopped working at sudden.&lt;/p&gt;
&lt;p&gt;Also, when you query the data from database in Appian / any other tools/programming language, first they need to retrieve the data and need to format the response as per their standard, such as datasubset/dictionary in case of Appian. Hence due to this you can expect minor difference in query execution duration while comparing with executing the same directly in DB Console.&lt;/p&gt;
&lt;p&gt;Hope above mentioned step will help you in debugging and solving this.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: a!queryEntity() timeout</title><link>https://community.appian.com/thread/59927?ContentTypeID=1</link><pubDate>Tue, 04 Sep 2018 04:48:58 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:2fa0e587-4114-4796-8632-bf807d49c46c</guid><dc:creator>Shanmukha</dc:creator><description>I agree with &lt;a href="/members/gianninol"&gt;gianninol&lt;/a&gt;, We have also used same approaches to get the data back from DB if it is taking too much time using query entity. Since query entity is running with in the boundaries (like time outs and other stuff) of Appian where as Execute Stored Procedure does not. If you are using Oracle EE 12 then I think it is now allowing the json format reading and returning the data from DB. Where are you using this query like are you showing data inside the grid or just to export it to excel? Scenarios may vary based on the need. &lt;br /&gt;
&lt;br /&gt;
If you still want to continue with the query entity then you may heck the following. Please ignore if yo have already tried below things.&lt;br /&gt;
&lt;br /&gt;
1) You can have more indexes or filters in the query or pagination as @chandu suggested. &lt;br /&gt;
2) You can increase query time out in the properties file but it will affect all other queries. &lt;br /&gt;
&lt;br /&gt;
 I hope this may help.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: a!queryEntity() timeout</title><link>https://community.appian.com/thread/59924?ContentTypeID=1</link><pubDate>Tue, 04 Sep 2018 03:31:00 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:68102e91-07a0-43fc-8802-64d9746996c5</guid><dc:creator>gianninol</dc:creator><description>&lt;p&gt;If you cannot find another solution, I have found success in the past by using the &amp;quot;Execute Stored Procedure&amp;quot; shared component to execute long-running queries, as that Smart Service is immune to the timeout of queryEntities (though I have never used the function that also comes with the shared component). This will also allow you to bypass the two-step query process that Appian uses and just get the desired rows, which going off what I&amp;#39;ve read in this post will reduce the time of the query to below the timeout threshold anyway.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: a!queryEntity() timeout</title><link>https://community.appian.com/thread/59919?ContentTypeID=1</link><pubDate>Mon, 03 Sep 2018 20:23:33 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:5a66d854-d0e3-4f48-a939-79ac05866334</guid><dc:creator>sergeiz</dc:creator><description>We have timeout of 90 seconds on Appian. I run a query in other tool and it starts return data in 25-110 seconds. But count takes 75-110 seconds. Query from Appian fails either almost on 90 seconds (timeout on count) or can return results in 130 seconds (count was below 90 seconds) which is longer than 90.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: a!queryEntity() timeout</title><link>https://community.appian.com/thread/59917?ContentTypeID=1</link><pubDate>Mon, 03 Sep 2018 16:30:16 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f88e3574-fd68-47fe-b0e7-9662410566d8</guid><dc:creator>chandu</dc:creator><description>Hi Sergeiz, you can get the N number of records using pagingInfo and with out giving Filter parameter for Query Entity.&lt;br /&gt;
We generally see that there will be noticeable difference between the running query directly in oracle DB and through Appian. But this is because some times the network latency and the load on the server.&lt;br /&gt;
if you still see the issue. can you check all the servers are up and running fine?&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: a!queryEntity() timeout</title><link>https://community.appian.com/thread/59915?ContentTypeID=1</link><pubDate>Mon, 03 Sep 2018 14:57:36 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:0e73a110-7cd4-4d5b-b0e2-744840f50998</guid><dc:creator>sergeiz</dc:creator><description>I still have this issue. As I understand Appian queries database in two steps: first, getting count and then taking data.&lt;br /&gt;
&lt;br /&gt;
My query returns first data fast enough but the count is very slow.&lt;br /&gt;
&lt;br /&gt;
Is there a way in Appian to just quickly grab the first N records?&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: a!queryEntity() timeout</title><link>https://community.appian.com/thread/53494?ContentTypeID=1</link><pubDate>Tue, 20 Mar 2018 12:56:37 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:9ed179e3-3c91-4f86-9335-2d2dc96d01a9</guid><dc:creator>sergeiz</dc:creator><description>Basically the query is select * from db_view where ref_id = some_value with the same value. It returns 20 rows in db tool and fails in Appian.&lt;br /&gt;
&lt;br /&gt;
Thanks for the perf_monitor_rdbms and database performance log reference. It looks like something was recently changed on the database side that made the view very slow.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: a!queryEntity() timeout</title><link>https://community.appian.com/thread/53489?ContentTypeID=1</link><pubDate>Tue, 20 Mar 2018 12:26:01 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:45ab2d0d-fb0f-4672-ad8f-c3bd24f951a4</guid><dc:creator>Justin Watts</dc:creator><description>There are various reasons this can occur - is there latency between Appian and the Oracle DB? are the filters applied exactly the same (maybe there are indexing issues or maybe the query isn&amp;#39;t *exactly* the same)?&lt;br /&gt;
&lt;br /&gt;
Can you share the queryEntity expression as well as the query in Oracle?&lt;br /&gt;
&lt;br /&gt;
Can you try running a simple select in Oracle and Appian and compare execution time? This might isolate a latency/network issue.&lt;br /&gt;
&lt;br /&gt;
Also, I would start by looking into the data store logs - &lt;a href="https://docs.appian.com/suite/help/17.4/Logging.html#data-store-performance-logs"&gt;docs.appian.com/.../Logging.html&lt;/a&gt;. If you are on Appian Cloud, the perf_monitor_rdbms.csv log that is enabled by default is very helpful in analyzing the query.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>