Subject Re: [firebird-support] Re: LEFT OUTER JOIN is extremely slow.
Author Ray Holme
Actually any integer type is faster than any string type. Using the
native integer type may be best, but not much of one as there are
assembler instructions for each and every integer type.

For those wondering - computers are best with numbers - they compare two
of them with one assembler instruction. Strings require iterative
compares one byte (9 or 16 bit bytes) at a time.

But NEVER join on two types that are NOT the same, unless you are trying
to see how slow you can go.

On Tue, 2012-05-01 at 12:46 +0200, Michael Ludwig wrote:
> Ray Holme schrieb am 30.04.2012 um 19:15 (-0400):
> > If you want performance too, make as many of your join criteria
> > numerical and of the same type. I try to search on strings but join
> > tables on integers (or bigints or shorts, doubles and floats are OK
> > but not as good)
> Yes. I once was given the advice to always use the native integer type
> of the machine for joins. Because that should be fastest.
> Guess that 32 bit integers are fine on a 64 bit hardware because
> that's
> such a common requirement.
> Michael