openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Catalina Wei (JIRA)" <>
Subject [jira] Reopened: (OPENJPA-703) Cache ResultObjectProvider data to improve query performance
Date Sun, 10 May 2009 22:00:45 GMT


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 from Employee e order by e.salary
5. query returning basic types but SQL result columns don't match with JPQL selections
    select, from Employee e

6. JPQL query returning boolean value where SQL returning 0 or 1
    select, 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:
>             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.

View raw message