|
I've got a 3.1 million row table with a 25 character field that
holds a street address, ex. '123 MAIN ST.'
We currently perform seraches by address like so:
select * from myTable where address like '%MAIN%'
Given the leading '%', I know the search will require a full
table (perhaps full index) scan.
Given that the average TRIM'd length of the data in the field is
16 and that RPG works much faster with varying fields. I was
thinking that if I changed the field to varying, the DB wouldn't
have any trailing blanks to compare too and thus my searches
should be about 36% faster...
However, I'm not seeing a 36% improvement. In fact, it appears
that performance is worse by a couple of percent!
Any thoughts as to why this is the case?
I've double checked the following:
- The varying field is set ALLOCATE(25)
- The data in the varying field is TRIM'd
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.