You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Catalina Wei (JIRA)" <ji...@apache.org> on 2009/05/11 00:00:45 UTC

[jira] Reopened: (OPENJPA-703) Cache ResultObjectProvider data to improve query performance

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

Catalina Wei reopened OPENJPA-703:
----------------------------------


The JPQL queries are not cached until PreparedResultObjectProvider and SQLProjectResultObjectProvider can handle complex query results. 
Queries having following characteristics are not cached:

1. resulting entity class is not candidate type,
    select e.dept from Employee e
2: query returning any embeddable class
    select e.address from Employee e
3. query returning more than one entity class
    select d, e from Dept d, in (d.emps) e
4. query contains ORDER BY clause
    select e.name from Employee e order by e.salary
5. query returning basic types but SQL result columns don't match with JPQL selections
    select e.name, e.name from Employee e

6. JPQL query returning boolean value where SQL returning 0 or 1
    select e.name, e.isManager from Employee e

The revision r773404 has code in place that detects the characteristics of queries and not caching them,
It is to  avoid cached query returning wrong answer.

The query cache-ability detection logic may not complete (
the query example 6 is currently cached and give wrong answer).

This issue is reopened to re-evaluate the cache-ability of the queries having the characteristics as listed above.


> Cache ResultObjectProvider data to improve query performance
> ------------------------------------------------------------
>
>                 Key: OPENJPA-703
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-703
>             Project: OpenJPA
>          Issue Type: Improvement
>          Components: kernel
>            Reporter: Ron Pressler
>            Assignee: Pinaki Poddar
>             Fix For: 2.0.0-M1
>
>         Attachments: PreparedQueryCache.pdf
>
>
> Profiling indicated that JDBCStoreQuery.populateSelect consumes a significant amount of CPU, and is executed every time a query is run. While, in fact, the actual PreparedStatement is created and run only in QueryImpl.toResult. It seems like the returned ResultObjectProvider from JDBCStoreQuery.executeQuery can be at least partially cached, or even cached in its entirety (provided care is taken with the context parameters). 
> It seems like such an improvement would significantly improve query performance.

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