Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
12 replies
Subscribers
8 subscribers
Views
5931 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
AI and Rules
How does a!QueryEntity works? I am fetching data from a table through a!que
vipins
over 9 years ago
How does a!QueryEntity works?
I am fetching data from a table through a!queryEntity. Table has n number of columns from which only one can have unique data (Primary Key Column). Others can have duplicate data.
I tried to fetch data in batchSize of 5. The problem is, for a column "Name", if a name is same in 12 rows, and I try to fetch data sorted by "Name" for startIndex 1. The identifiers (primary key) comes: 14; 18; 17; 16; 15. Then I change the startIndex to 6, the identifier comes: 19; 18; 17; 16; 15. Now I change the startIndex to 11, the identifier comes: 16; 15; 4; 7; 6.
If you observe, there is some same data coming in every Set (18,17,16,15 -- > 18,17,16,15 --> 16,15). After that identifier changes because same name is there in table for 12 times only.
Can anyone explain why is this happening ?
Why the same/duplicate data is coming even when data is sorted on that column and startIndex is changing?
I am using a Oracle DB. I ha...
Query
OriginalPostID-184999
OriginalPostID-184999
Discussion posts and replies are publicly visible
Parents
0
PhilB
A Score Level 1
over 9 years ago
Is there a reason you're using query entity, such as a large amount of fields in the data store entity? I've noticed that "best practice" has recently moved towards wider use of query entity, but I don't believe this is necessarily correct. In your example, you could create a view that shows a subset of the table, reducing the number of fields in the data store entity, and then use a query rule with multiple sort inputs to work around the lack of sorting functionality in a!queryEntity. You could even do any required table joins within that view, which should perform better than using nested CDTs or multiple calls to a!queryEntity.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Reply
0
PhilB
A Score Level 1
over 9 years ago
Is there a reason you're using query entity, such as a large amount of fields in the data store entity? I've noticed that "best practice" has recently moved towards wider use of query entity, but I don't believe this is necessarily correct. In your example, you could create a view that shows a subset of the table, reducing the number of fields in the data store entity, and then use a query rule with multiple sort inputs to work around the lack of sorting functionality in a!queryEntity. You could even do any required table joins within that view, which should perform better than using nested CDTs or multiple calls to a!queryEntity.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Children
No Data