You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Kevin Sutter (JIRA)" <ji...@apache.org> on 2008/01/31 00:01:36 UTC

[jira] Updated: (OPENJPA-407) Cache SQL (or closer precursors to SQL) more aggressively

     [ https://issues.apache.org/jira/browse/OPENJPA-407?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kevin Sutter updated OPENJPA-407:
---------------------------------

    Attachment: findBy.patch

Instead of trying to resolve the whole sql caching problem, how about if we just start with caching the SQL for the findBy operation?  Each Entity type has a unique SelectImpl and SQLBuffer associated with processing a find(class, id) operation, right?  So, why not cache these results so that they can be re-used the next time the find operation is invoked?

Looking back at Patrick's first patch for this issue, it looks like a few of the original ideas are duplicated in my patch.  I am making the assumption that the EntityManager (and the associated JDBCStoreManager) is single-threaded.  I am also making the assumption that the find method (and only the find method) utilizes the getInitializeStateResult() on the JDBCStoreManager.  

This is still a prototype at this point, but I would like to get some input as to the direction.  The initial results look very promising.  I've driven it with many clients with the findBy's performance increasing anywhere from 5-20% depending on the number of clients and machine capacity.  Of course, this is limited to findBy's at this point, but if the general direction is okay, maybe we can extend it to more general queries.

Just looking for input at this point.  BTW, my findBy.patch file works with the 1.0.x branch.  Still hoping we can improve the performance of the service stream....

Kevin

> Cache SQL (or closer precursors to SQL) more aggressively
> ---------------------------------------------------------
>
>                 Key: OPENJPA-407
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-407
>             Project: OpenJPA
>          Issue Type: Improvement
>          Components: jdbc, kernel, query, sql
>    Affects Versions: 0.9.0, 0.9.6, 0.9.7, 1.0.0
>            Reporter: Patrick Linskey
>             Fix For: 1.1.0
>
>         Attachments: findBy.patch, OPENJPA-407.patch
>
>
> When data is not available in the data cache, OpenJPA dynamically creates SQL to look up the requested data. OpenJPA should more aggressively cache this SQL to accelerate pathways from a cache miss to the database.
> The generated SQL takes a number of factors into account, including the requested records, transaction status, currently-loaded data, and the current fetch configuration. Any caching would need to account for these factors as well.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.