Friday, December 23, 2011

RowCount Vs EstimatedRowCount Vs FetchedRowCount

getRowCount():
Method getRowCount() retrives all the records from View Object by executing ViewObject Query.The count is calculated by traversing the Viewobject using next() method until the
last record is retrived. This method hinders the performance of application incase of VO with large number of rows.

getEstimatedRowCount():
To obtain a quicker count, getEstimatedRowCount() can be used. Method getEstimatedRowCount() actually retrives the count by hitting getQueryHitCount() which runs the select count(*) on the VO query.

getFetchedRowCount():
Method getFetchedRowCount() counts the number of rows from the Result Set.if getFetchedRowCount()

1 comment:

sai_explorer said...

In the case of Programmatic view object , we won't have select count query then select count(*) will error out . Isn't it ?