Main   Products   Offshore Outsourcing   Customers   Partners   ContactUs  
JDBC Databases
  HXTT Access v5.2
 
  Buy Now
  Support
  Download
  Document
  FAQ
  HXTT Cobol v2.1
  HXTT DBF v5.2
  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)

HXTT ACCESS
Terrible Performance On Non-Indexed Joins
Martin Ross
2006-06-18 19:03:20.0
Given a query in the form
select a from TableA a
join TableB b
on a.primarykey || '' = b.foreignkey

HXTT blows up and doesn't return.. The relative table sizes are both less than 100k rows.

Why do I need such a strange join? A combination of legacy data, hibernate, and inability to touch the schema and datasources.

In general, I suppose the hibernate optimiser should be able to pick an index for trivial optimization cases like the above...

M
Re:Terrible Performance On Non-Indexed Joins
HXTT Support
2006-06-18 19:24:16.0
We will test it soon.
select a from TableA a
join TableB b
on a.primarykey || '' = b.foreignkey ?

Why do you try
select a from TableA a
join TableB b
on a.primarykey= b.foreignkey ?

HXTT Aceess won't quicken a.primarykey || ''.
Re:Re:Terrible Performance On Non-Indexed Joins
Martin Ross
2006-06-18 19:35:55.0
The problem is that because the SQL is generated by hibernate framework.

The real issue is the following

a.primarykey is a VARCHAR(10). BUT... the value is stored with right padded spaces.
e.g. '12345 ' not '12345'.

The problem is that b.foreignkey is also VARCHAR(10), but NOT stored with right spaces. This is moronic schema, but I am working with legacy data so I don't really have a choice to change the schema.

Basically the problem is this..
Table a
join Table b
on a.primarykey = b.primarykey returns results of the join. Which is the correct behaviour that matches access. The problem is that

len(a.primarykey) != len(b.primarykey) and the results return to java leave us with !aJavaObject.primarykey.equals(bJavaObject.foreignkey).
e.g. a.primarykey = '12345 '
b.foreignkey = '12345'

This causes big problems for Hibernate. The way to solve the problem is to append a '' to force HXTT to treat a.primarkey as a VARCHAR(10), strip the spaces and return a.primarykey = '12345'.

Hope this helps.
Re:Re:Re:Terrible Performance On Non-Indexed Joins
Martin Ross
2006-06-18 19:37:27.0
Oh... I noticed after I posed that the comment poster is stripping spaces.

should read
e.g. '12345' not '12345'

Re:Re:Re:Re:Terrible Performance On Non-Indexed Joins
Martin Ross
2006-06-18 19:38:21.0
WTF.. Anything in the single quotes is getting striped..

should really read
e.g. '12345' || 5 MORE SPACES, not '12345'
Re:Re:Re:Re:Re:Terrible Performance On Non-Indexed Joins
HXTT Support
2006-06-18 21:45:27.0
I guess primarykey is an indexed column, so you can use:

select a from TableA a
join TableB b
on a.primarykey= RPAD((b.foreignkey,10,' ')

Re:Re:Re:Re:Re:Re:Terrible Performance On Non-Indexed Joins
HXTT Support
2006-06-20 01:42:24.0
Please let us know that speed resultwith the suggested sql. If it's slow still, we will analyse and give a solution.

Search Key   Search by Last 50 Questions




Google
 

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