Here's the result of the benchmarking you've requested. Attached are the
files used for this benchmark. Please comment if I did the testing the wrong
way and how it should be done.

Testing procedures:
1. Entity ProductFacility was used for both tests. ProductFacility has 21897
rows at the time of the testing.
2. Both test were deployed as a service which is being called thru 'Run
Service' available under Webtools
3. Services are called alternately, starting with testLimitOffset, clearing
cache after each execution of a service.
4. Each service has a viewSize of 100 and viewIndex of 217.
5. Note that org.ofbiz.entity.util.EntityFindOptions (of rev 496982) and
org.ofbiz.entity.datasource.GenericDAO (of rev 686591) were changed to
accommodate insertions of LIMIT and OFFSET into the sql builder. I added a
field 'offset' and getter-setter for it for the class
org.ofbiz.entity.util.EntityFindOptions. I inserted the following lines on
line 724 for the class org.ofbiz.entity.datasource.GenericDAO. Modified
classes are attached for your inspection.

-- start code --
    // LIMIT
    if (findOptions.getMaxRows() > 0) {
      sqlBuffer.append(" LIMIT " + findOptions.getMaxRows());
    }

    // OFFSET
    if (findOptions.getOffset() > 0) {
      sqlBuffer.append(" OFFSET " + findOptions.getOffset());
    }
-- end code --

6. The database being used is postgresql 8.1
7. Platform specs: Intel CoreDuo 1.8Ghz, 2gb Ram, Windows XP ver 2002 SP 2

Test Results are as follow:
testResultSet:
797, 875, 750, 750, 765 (Ave: 787.4 ms)
generated sql: SELECT PRODUCT_ID, FACILITY_ID, MINIMUM_STOCK,
REORDER_QUANTITY, DAYS_TO_SHIP, LAST_UPDATED_STAMP, LAST_UPDATED_TX_STAMP,
CREATED_STAMP, CREATED_TX_STAMP, MAXIMUM_STOCK, ALLOCATION FROM
public.PRODUCT_FACILITY

testLimitOffset:
141, 125, 109, 93, 94 (Ave: 112.4 ms)
generated sql: SELECT PRODUCT_ID, FACILITY_ID, MINIMUM_STOCK,
REORDER_QUANTITY, DAYS_TO_SHIP, LAST_UPDATED_STAMP, LAST_UPDATED_TX_STAMP,
CREATED_STAMP, CREATED_TX_STAMP, MAXIMUM_STOCK, ALLOCATION FROM
public.PRODUCT_FACILITY LIMIT 100 OFFSET 21700


Also, why not set the cursor size and what not (as is done, optional of
> course, in the entityengine.xml file)?

Sorry I dont understand what you mean by this.

Again, thank you very much for your time.

~ ian

On Tue, Sep 9, 2008 at 9:17 PM, David E Jones <[EMAIL PROTECTED]>wrote:

>
> What are the database and JDBC driver versions you are working with?
>
> Also, the JDBC code you included does a few things differently than what
> the Entity Engine does. Have you done similar tests using the Entity Engine
> instead of plain JDBC? Also, why not set the cursor size and what not (as is
> done, optional of course, in the entityengine.xml file)?
>
> -David

Reply via email to