Subject | Re: [ib-support] Indexs! |
---|---|
Author | Ann W. Harrison |
Post date | 2002-09-30T16:00:57Z |
At 11:25 AM 9/30/2002 -0400, Thomas Miller wrote:
least selective column(s) first, and the most selective last. That
will help compression, thus reduce the size of the index.
indexes and some of those indexes are pretty dreadful. Consider that
you have a product that you sell to men, women, and dogs. You don't
want any children or cats as purchasers. So, you create a table of
customer types with three entries and a foreign key constraint that
insures that all customer records are associated with men, women, and
dogs. That creates an index on the customer record that contains only
three distinct values - it gets pretty slow when you have more than
a couple hundred thousand customers.
foreign key constraints automatically create indexes, so there
is no need to declare indexes on those columns.
Regards,
Ann
www.ibphoenix.com
We have answers.
>We currently write our software for Oracle and I am very familiar withGreat! One step in the right direction.
>how Oracle uses indecies for speed. We are currently converting our
>software to
>also run on FB.
>Back in the 5.x days of IB, I was told never to create indecies made upNever was. When you create multi-segment indexes, you should put the
>of multiple columns. Is that still true?
least selective column(s) first, and the most selective last. That
will help compression, thus reduce the size of the index.
>Any other insights would also be welcome.Be careful with foreign key constraints. They automatically create
indexes and some of those indexes are pretty dreadful. Consider that
you have a product that you sell to men, women, and dogs. You don't
want any children or cats as purchasers. So, you create a table of
customer types with three entries and a foreign key constraint that
insures that all customer records are associated with men, women, and
dogs. That creates an index on the customer record that contains only
three distinct values - it gets pretty slow when you have more than
a couple hundred thousand customers.
>When I create a primary key, the engine makes two indexes. One as a primaryAre you sure you didn't create the other index. Primary and
>key and one that it not. They both are indecies of the primary key. Is
>this a bug?
foreign key constraints automatically create indexes, so there
is no need to declare indexes on those columns.
Regards,
Ann
www.ibphoenix.com
We have answers.