Main   Products   Offshore Outsourcing   Customers   Partners   ContactUs  
JDBC Databases
  HXTT Access v5.2
  HXTT Cobol v2.1
  HXTT DBF v5.2
  Buy Now
  HXTT Excel v4.2
  HXTT Paradox v5.2
  HXTT Text(CSV) v5.2
  HXTT XML v1.2
Offshore Outsourcing
Oracle Data Import/Export
DB2 Data Import/Export
Sybase Data Import/Export
Free Resources
  Firewall Tunneling
  Search Indexing Robot
  Conditional Compilation
  Password Recovery for MS Access
  Password Recovery for Corel Paradox
  Checksum Tool for MD5
  Character Set Converter
  Pyramid - Poker of ZYH
Hongxin Technology & Trade Ltd. of Xiangtan City (abbr, HXTT)

Poor DBF Left Outer Join Performance
Martin Ross
2006-02-24 00:00:00.0
This query performs terribly.... As in more than 10 minutes...

select count(*) from YM_INV this_
left outer join YM_DOC yorkmedica2_
on this_.DOCTOR=yorkmedica2_.CODE
left outer join YM_PAT yorkmedica3_
on this_.ID=yorkmedica3_.ID
where this_.SERV_DATE>'2005-01-01'

These tables can individually be accessed rather quickly. Let me know if you want the schema for the tables.



Re:Poor DBF Left Outer Join Performance
Martin Ross
2006-02-24 00:00:00.0
It seems to be stuck in this part of the stack trace

Thread [main] (Stepping)
cp.a(int, bp[], bu, g, int, boolean, int, String) line: not available
dg.a(int, boolean, int, String) line: not available
cp.a(boolean, cx, aa, int, boolean, boolean, int, String) line: not available
u(ba).a(aa, int, b9, m, Object) line: not available
cq(aa).a(int, b9, m, Object) line: not available
cq.executeQuery() line: not available [local variables unavailable]
NonBatchingBatcher(AbstractBatcher).getResultSet(PreparedStatement) line: 139
CriteriaLoader(Loader).getResultSet(PreparedStatement, boolean, boolean, RowSelection, SessionImplementor) line: 1669
CriteriaLoader(Loader).doQuery(SessionImplementor, QueryParameters, boolean) line: 662
CriteriaLoader(Loader).doQueryAndInitializeNonLazyCollections(SessionImplementor, QueryParameters, boolean) line: 224
CriteriaLoader(Loader).doList(SessionImplementor, QueryParameters) line: 2145
CriteriaLoader(Loader).listIgnoreQueryCache(SessionImplementor, QueryParameters) line: 2029
CriteriaLoader(Loader).list(SessionImplementor, QueryParameters, Set, Type[]) line: 2024
CriteriaLoader.list(SessionImplementor) line: 94
SessionImpl.list(CriteriaImpl) line: 1552
CriteriaImpl.list() line: 283
YorkMedicalDocDB(DocDBGeneric).getServices(Criteria) line: 47
BridgeDoctorDBCommand.execute() line: 278
BridgeDoctor.main(String[]) line: 736
Re:Re:Poor DBF Left Outer Join Performance
Martin Ross
2006-02-24 00:00:00.0
By stuck I mean that the cp.a method calls lots of other methods as it executes, but driver is basically looping in this method.
Re:Re:Re:Poor DBF Left Outer Join Performance
HXTT Support
2006-02-28 00:00:00.0
HXTT DBF had to do full table search since there's no suitable index for your tables. Please download the latest package which will uses automatic temporary index to quicken join sql. According to our test:
YM_INV (20000 rows), YM_DOC(500 rows), and YM_PAT (2000 rows) without any prefined index.

Your sql will get a result in 2s which includes building temporary index operation.
Re:Re:Re:Re:Poor DBF Left Outer Join Performance
Martin Ross
2006-02-28 00:00:00.0

Will it always create temporary tables for joins or will it do a cost estimation first?
Re:Re:Re:Re:Re:Poor DBF Left Outer Join Performance
HXTT Support
2006-02-28 00:00:00.0
It will only create only the necessary index. For your sql, it will create inde x on yorkmedica3_.ID and yorkmedica2_.CODE. If you is using inner join, not left out join, it will transform your sql to YM_INV this_, YM_DOC yorkmedica2_ , YM_PAT yorkmedica3_ where this_.DOCTOR=yorkmedica2_.CODE and this_.ID=yorkmedica3_.ID and this_.SERV_DATE>'2005-01-01', then it will adjust table order sometimes, and choose the suitable index.
If you run many join sqls in a short period, the following sql will utilize the temporary index created by the first join sql.

Search Key   Search by Last 50 Questions


Address: 9 Station Rd., Xiangtan City, Hunan Province, P.R. China
Postcode: 411100
Phone: (86)731-58225727
Fax: (86)731-58225727
Copyright © 1999-2011 Hongxin Technology & Trade Ltd. | All Rights Reserved. | Privacy | Legal | Sitemap