Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Performance while checking record count of a query object

Explorer ,
Mar 26, 2015 Mar 26, 2015

I can check whether a query results contains any record count or not in any of the following ways.

1 <cfif myQueryObject.recordCount>

        ---- some logic ----

  </cfif>

2 <cfif myQueryObject.recordCount GT 0>

        ---- some logic ----

  </cfif>

Can any one guide me saying which one will provide a better performance.

Your timely help is well appreciated.

601
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Mar 27, 2015 Mar 27, 2015
LATEST

There will be no noticeable performance difference between then two of these. They are pretty much exactly the  same except one is checking the boolean state and the other the actual value. I don't think you could even measure the difference in performance with it being so small, IF there even was a difference.

Your usage will come down to the standard you are using. Stick to one throughout. Like you say both are viable options to checking the result.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources