Subject | Re: [ib-support] Re: Exists versus select first |
---|---|
Author | Ann W. Harrison |
Post date | 2002-03-21T17:48:52Z |
At 02:24 PM 3/21/2002 -0300, Marcos Vinicius wrote:
the same rules apply. The basic rule on index keys is that
a shorter key is faster than a longer key because more keys
fit on a page in the index. That becomes somewhat more complex
when you consider prefix compression. There's no difference
in length between an index on a long integer that contains
the values 1, 2, 3, 4, 5 and one that contains AAAAAAAA,
AAAAAAAB, AAAAAAAC, AAAAAAAD.
Pick values that make sense for your application.
Regards,
Ann
www.ibphoenix.com
We have answers.
>Tanks Ann and Andrew. By the way, speak about keys make I remember anotherPrimary keys are just indexes with some special handling, so
>question: Integers PKs are faster that varchar PKs? Same to indexes?
the same rules apply. The basic rule on index keys is that
a shorter key is faster than a longer key because more keys
fit on a page in the index. That becomes somewhat more complex
when you consider prefix compression. There's no difference
in length between an index on a long integer that contains
the values 1, 2, 3, 4, 5 and one that contains AAAAAAAA,
AAAAAAAB, AAAAAAAC, AAAAAAAD.
Pick values that make sense for your application.
Regards,
Ann
www.ibphoenix.com
We have answers.