Notifications
Announcements
No record found.
What is the difference between firstOnly and firstFast keyword in a select statement and when should we use them?
*This post is locked for comments
firstFast
A priority hint. The first row appears more quickly but the total return time for this option might be slower. The firstFast hint is automatically issued from all forms, but is rarely used directly from X++.
firstOnly
Speeds up the fetch. Instructs MorphX to fetch only the first record
From Select Statement Syntax [AX 2012]
Hi Rohan, firstOnly will select only the first record in the query so should be used when you need a single record only e.g. in the find method of your table. FirstFast will return the first records in the query faster than the following records, this makes sense when you are viewing data in a form but total time it takes might be more. Have a look at this article on MSDN.
firstOnly returns (maximum) one record, it is used if you know in advance there will be only one record in the result set (when selecting on recId for example)
with firstFast your resultset can have multiple records, but it makes sure the first one is fetched faster than the remaining ones.
It is used for performance optimization (on forms and list pages for example, check blogs.msdn.com/.../ax2012-list-pages-performance-improvement.aspx)
Thanks Anton and FH-Inway.
Thanks Tom.
If our answers answered your question, you can mark them as accepted, this way other users will know quickly if this question has an answer or not.
Clear and precise. Wonderful
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 4 Most Valuable Professional
Priya_K 4
MyDynamicsNAV 2