Friday, July 24, 2009

Performance Tuning, Range Paging Last operation, bug

So I started working on Performance Tuning with Range Paging as Steve suggested.
In order to have more realistic performance tests I created a lot of employees (200000) using the following database procedure:

create or replace
FOR i IN 1..200000 LOOP
Insert into employees (employee_id,
select employees_seq.nextval as employee_id,
'auto' i as last_name,
'aut' i '' as email,
sysdate as hire_date,
'IT_PROG' as job_id
from dual;

So I tested Range Paging and I actually saw the difference in query page, while scrolling down the results of query criteria.
Then I go to Edit page and I press Last button. Then I get this error:
oracle.jbo.InvalidOperException: JBO-25084: Cannot call last() on row set EmployeesView1 because the access mode uses range-paging

I guess since its a jbo exception it is not a bug?
It doesn't say much for the user though...
So in order for performance we must not have a 'Last' button?
Or is better to use diferent view object for query and for edit?


  1. range paging is used to jump to a specific page in an ordered set of results without retrieving all the rows prior to the page you want to display. You use range paging when you want to allow the user to scroll through a large number of rows (another approach might be forcing them to search to reduce the rows to some reasonable number without allowing them to scroll through the entire set). We don't currently support doing a last() operation in range paging mode because we'd need to count the rows in the table in order to figure out what page of rows included the last one. You can achieve a "last page" button type of functionality by combining the getRangePageCount() function with the scrollToRangePage(int) method.

  2. Yes, its just that as it is described in developer guide:

    However, when you must work with very large result sets, typically over 100 rows, you can use the view object's access mode called "range paging" to improve performance.

    so as i see it most of view objects should have "range paging" and if there is a generic way to go to last row (fast) it should be in the framework. if not then i have to select between bad performance or no 'Last' button