You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ofbiz.apache.org by "Nicolas Malin (Jira)" <ji...@apache.org> on 2026/06/09 13:01:00 UTC
[jira] [Closed] (OFBIZ-13366) Refactor Entity Find Logic to Use Limit and Offset for Scalable Data Retrieval
[ https://issues.apache.org/jira/browse/OFBIZ-13366?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Nicolas Malin closed OFBIZ-13366.
---------------------------------
Resolution: Done
Hello [~pushprajsinghjadoun], I pushed your code in trunk.
Thanks for this improvement !
> Refactor Entity Find Logic to Use Limit and Offset for Scalable Data Retrieval
> ------------------------------------------------------------------------------
>
> Key: OFBIZ-13366
> URL: https://issues.apache.org/jira/browse/OFBIZ-13366
> Project: OFBiz
> Issue Type: Improvement
> Components: webtools
> Reporter: Pushpraj Singh Jadon
> Assignee: Nicolas Malin
> Priority: Major
> Labels: performance, webtools
>
> h2. Problem Statement
> Currently, the {{FindGeneric.groovy}} script is responsible for retrieving data for entity views. However, its existing data-fetching approach becomes inefficient when working with large datasets.
> When entities contain millions of records, the current pagination mechanism may load a significantly larger number of records into memory than required. In some cases, the system retrieves most—or all—records before applying pagination logic in memory.
> For example, when a user requests to view only the last 20 records, the system may still load a much larger dataset into memory before filtering the results for display. This leads to unnecessary memory consumption and performance degradation.
> h2. Proposed Solution
> Refactor the data retrieval logic in the following script:
> framework/webtools/groovyScripts/entity/FindGeneric.groovy
>
> The refactoring will be used explicitly {{EntityFindOptions}} with proper {{limit}} and {{offset}} values. By pushing pagination logic down to the database layer, only the records required for the current view will be fetched.
> h2. Benefits
> * *Reduced Memory Usage*
> Only the records required for the current page are loaded into memory.
> * *Improved Performance*
> Faster response times when working with large entities, as pagination is handled directly by the database.
> * *Improved Scalability*
> Enables Webtools to efficiently manage entities containing millions of records without excessive resource consumption or risk of memory issues.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)