Are you sure about these results? The test case sounds really funny, but 
however it was done if the same operations are being done with both this sort 
of difference would REALLY surprise me. In the first 2-3 years of development 
on entity engine I spent around 200 hours doing profiling and optimization, and 
based on that the comparison to JDBC was that the entity engine generally had 
around a 10-20% overhead over JDBC, and generally much less (because compared 
to the network overhead the EE wrapper objects, especially using recycled 
objects, has very little overhead).

It has been about 3 years since that, but I'd still be really surprised if 
something has changed that significantly since then.

-David


[EMAIL PROTECTED] wrote:
I did some simple tests to retrieve data back when I was doings comparisons
of SOAP and XML-RPC performance. This test was on the Product table with
2000 sequential keys and then doing a binary halving to retrieve the
records, i.e. record 1000 first, followed by 500 and then 1500, etc (to
overcome database caching).

I did this in a loop both for
delegator.findByAnd("Product",UtilMisc.toMap("partyId", client));

and

r = sStatement.executeQuery("SELECT * FROM " + DATABASENAME + " where " +
FID + " = '" + client + "'");

These ran in separate loops, one after the other and I moved the order so
the delegrator group ran first and then second.

The results were that it took an averate of 6 msecs to do the executeQuery
call and 23 msecs to do the delegator call.

Skip

-----Original Message-----
From: Jonathon -- Improov [mailto:[EMAIL PROTECTED]
Sent: Sunday, September 16, 2007 3:44 AM
To: [email protected]
Subject: Re: Accessing database through bsh script.


20msec of what total? That is, what percentage is that 20msec?

I'm assuming there is grouping and summary data in the query?

Another important question is, how many tables, conditionals, etc?

BUT... before you waste time answering my questions, the real question is
this. Exactly what kind
of query is Vijay trying to optimize? Always best to treat the exact problem
encountered.

Jonathon

[EMAIL PROTECTED] wrote:
In my testing, there is an approximate 20msec hit using the entity engine
over raw jdbc, depending of course on the query, is there a seca involved,
etc.

Skip

-----Original Message-----
From: vijay Si [mailto:[EMAIL PROTECTED]
Sent: Saturday, September 15, 2007 10:28 AM
To: [email protected]
Subject: Re: Accessing database through bsh script.


Jonathon

It seems that other option left is to use a jdbc connection to database.
Is
it also imperative then, that for very complex querries having
"groupby"..."having" and other clauses it is better to use jdbc method of
connection.

How does it affect the ofbiz philosophy of architecture if i use jdbc for
executing these querries. As right now i cannot find any ways of
implementing those aggregate functions(sum,min,max...) through Entity
Engine
(without creating views). Also do you have any idea of performance
behaviour
on using jdbc connection?

Thanks.


On 9/15/07, Jonathon -- Improov <[EMAIL PROTECTED]> wrote:
There's no other (easy) way to query database, aside from using the
Entity
Engine (which was what
I suggested).

If you're worried about performance hit with a huge (and unconditional)
cross-product, see
http://www.nabble.com/forum/ViewPost.jtp?post=12590081&framed=y and
https://issues.apache.org/jira/browse/OFBIZ-1232

Jonathon

vijay Si wrote:
Hi Jonathon,

i cannot use the view-entity for querrying, as it would cause a
performance
hit. Is there any other method to get the above querry. Do u know of any
ways to do it through bsh script.


Regards


On 9/15/07, Jonathon -- Improov <[EMAIL PROTECTED]> wrote:
Use the GenericDelegator and related classes, I think. Or maybe not. I
can't recall the aggregate
functions there.

The entity definitions do have those, though. The <view-entity>? Oh
yes,
the <view-entity>.

Try using DynamicViewEntity to construct a <view-entity>.

Jonathon

vijay Si wrote:
Is there any funtionality provided for using aggregate functions
(sum,min,max..) and count()  for querrying to data base through bsh.

for egg: how can we write following in BSH :

Select sum(order_id),sum(grand_total) from order_header  where
order_type_id="PURCHASE_ORDER";

Regards




------------------------------------------------------------------------
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.487 / Virus Database: 269.13.19/1008 - Release Date:
9/14/2007 8:59 AM


------------------------------------------------------------------------

No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.487 / Virus Database: 269.13.19/1008 - Release Date:
9/14/2007 8:59 AM





Reply via email to