Speed Up Tables Join Query

C

Charles Tam

Does a table join query between Byte fields faster than between String fields?

e.g. table_1.byte_field joins with table_2.byte_field VS
table_3.string_field joins with table_4.string_field.
 
A

Allen Browne

To get a definative answer, you would need to measure it.

In general, the Byte field type is slower than the Integer or Long, and you
could expect the Text types to be slower again depending on the number of
characters actually being compared.
 
C

Charles Tam

Why does the Byte field type slower than Integer or Long?
The data size are:
Byte is 1 byte, Integer is 2 bytes and Long is 4 bytes. Doesn't size matter?
 
A

Allen Browne

You are working on a 32-bit operating system, so it processes 4 bytes as
well.

Because lots of software (including Access) had 16-bit origins, it and the
o/s runs it through the CPU at about the same speed.

However, the Byte type was only added to 32-bit versions, and the neither
the software nor compilers are optimized to handle data of this size. The
difference is marginal, probably even irrelevant, but you certainly won't
find the Byte being processed as quickly.
 
C

Charles Tam

Thanks for your information.

Allen Browne said:
You are working on a 32-bit operating system, so it processes 4 bytes as
well.

Because lots of software (including Access) had 16-bit origins, it and the
o/s runs it through the CPU at about the same speed.

However, the Byte type was only added to 32-bit versions, and the neither
the software nor compilers are optimized to handle data of this size. The
difference is marginal, probably even irrelevant, but you certainly won't
find the Byte being processed as quickly.
 
Top