performance - Is checking no.of rows before fetching them more efficient than directly fetching all data in hibernate? -


I have a scenario

  1. En as the minimum number of lines expected for the transaction .
  2. Select the number select count (*) to find the number of criteria for the satisfying criteria.
  3. If the result of step 2 is equal to or greater than N, then proceed or leave exception.
  4. Bring the real object to n for the hibernate query.
  5. Logging and saving the object.

Is bringing above the more efficient or straight object and will be more efficient to check the size of the result set?

I do not need data if at least 'N' rows are not satisfactory criteria?

PS: Can better be set up like Maxis like Maxis?

Is bringing the above more efficient or straight object and checking the size of the result set Will it be more efficient?

I can say that it depends on the likelihood of the least result :

  • If this event is very likely If this incident is extraordinary, then the object will be more efficient than bringing it.

Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -