[EMAIL PROTECTED] wrote: > 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. >
Perhaps a update of your table statistics could help. Try "update stat <tabname>" for every join table. For more information about the update stat command see: http://www.sapdb.org/htmhelp/3b/86f067458411d3a98200a0c9449261/frameset.htm If this doesn't help feel free to contact me directly. Kind regards, Holger SAP Labs Berlin _______________________________________________ sapdb.general mailing list [EMAIL PROTECTED] http://listserv.sap.com/mailman/listinfo/sapdb.general
