Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Difference between firstOnly and firstFast

(0) ShareShare
ReportReport
Posted on by

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

  • Huggins Mafigu Profile Picture
    480 on at
    RE: Difference between firstOnly and firstFast

    Clear and precise. Wonderful

  • Florian Hopfner Profile Picture
    2,451 on at
    RE: Query

    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.

  • Community Member Profile Picture
    on at
    RE: Query

    Thanks Tom.

  • Community Member Profile Picture
    on at
    RE: Query

    Thanks Anton and FH-Inway.

  • Verified answer
    Community Member Profile Picture
    on at
    RE: Query

    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)

  • Verified answer
    Anton Venter Profile Picture
    19,607 Super User 2025 Season 1 on at
    RE: Query

    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.

  • Verified answer
    Florian Hopfner Profile Picture
    2,451 on at
    RE: Query

    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]

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.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,217 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,978 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans