Hello,

I have a problem with the speed of joins in SapDB.

Take a look at the following query:

SELECT T6.objectid
FROM T1,T2,T3,T4,T5,T6
WHERE T1.objectid = T2.T1objectid AND T2.objectid = T3.T2objectid AND
T3.objectid = T4.T3objectid AND T4.objectid = T5.T4objectid AND T5.objectid =
T6.T5objectid AND T3.objectid = 345

It was originally written using SQL92's joins, but that part of SAPDB was
buggy, so I rewrote it to oracle syntax.

Using 10000 records/table and PRIMARY KEY on all 'objectid' fields, this query
took about 700ms to run, using JDBC and PreparedStatement, taking the average
of 100 runs using the same connection.

If I truncated it to 5 tables (T1, T2, T3, T4, T5), it finished in 370ms.
Same way, 4 tables only took 7.8ms (!!!).

I wonder what is the cause of this enermous difference. Am I doing something
wrong? How could I speed up the queryies with more tables joined?
Otherwise, SapDB run at a _very_ convincing speed, without problems.

Regards,
Agoston Horvath

_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general

Reply via email to