Main   Products   Offshore Outsourcing   Customers   Partners   ContactUs  
JDBC Databases
  HXTT Access v7.1
 
  Buy Now
  Support
  Download
  Document
  FAQ
  HXTT Cobol v5.0
  HXTT DBF v7.1
  HXTT Excel v6.1
  HXTT Json v1.0
  HXTT Paradox v7.1
  HXTT PDF v2.0
  HXTT Text(CSV) v7.1
  HXTT Word v1.1
  HXTT XML v4.0
Offshore Outsourcing
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
   
   
   
Heng Xing Tian Tai Lab of Xi'an City (abbr, HXTT)

HXTT ACCESS
Terrible Performance On Non-Indexed Joins
Martin Ross
2006-06-18 19:03:20
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
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
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
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
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
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
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
 

Email: webmaster@hxtt.com
Copyright © 2003-2019 Heng Xing Tian Tai Lab of Xi'an City. | All Rights Reserved. | Privacy | Legal | Refund | Sitemap