posted 19 years ago
Hi there,
I have 3 tables that look something like this:
pricelistrelease:
*rowid
*releasedate
*name
product
*rowid
*name
*lots other stuff
referenceproductprice
*rowid
*pricelistrelease
*product
*price
Now I would like to get all of the products that belong to a certain pricelistrelease, and have their prices.. So I do a findAllOnPricelistrelease finder query on the referenceproductprice home interface.
The query looks like this:
SELECT OBJECT(rpp)
FROM ReferenceProductPrice rpp
WHERE rpp.pricelistRelease.row_id = ?1
This will get all of the referenceproductprices I need. In the code I create an object that contains all of the referenceproductprice data, and all of the product data. This means that for eacht referenceproductprice, my app server will do another query to get all of the productinformation needed to fille the object. This results in a gigantic number of queries (product exists of some subbeans), and I usually have to wait for about 4 mins before I get my data (runs on a Xeon 2GHz, 1gig ram).
In normal SQL I would write a simple query that contains some INNER JOINS.
Is there a way to enhance the performance a lot? (own inner join query takes about half a second)
thanks!