Subject | RE: [firebird-support] Re: 'select' with delays ref/eDN5012844953 |
---|---|
Author | Helen Borrie |
Post date | 2007-01-22T21:15:06Z |
At 12:01 AM 23/01/2007, you wrote:
A primary key is a constraint. It is supported by an automatically
created unique index.
A foreign key is a constraint, supported by an automatically created
non-unique index.
A unique key is a constraint, supported by an automatically created
unique index.
There is no such animal as an external index; although all indexes
are maintained on pages separate from the tables' data pages.
Do you mean you have a composite primary key consisting of three keys?
I do not understand the second part of the question.
ordered by a date field in descending order. The suggested answer to
that speed up the *ordering* part of the operation, you needed a
descending index on that field.
./heLen
>Hello HellenDon't get confused. An index has one or more keys.
>
>
>
>Yes I have a descending index, I think I have mentioned it, it is external
>index (it is not included in the all key fields).
A primary key is a constraint. It is supported by an automatically
created unique index.
A foreign key is a constraint, supported by an automatically created
non-unique index.
A unique key is a constraint, supported by an automatically created
unique index.
There is no such animal as an external index; although all indexes
are maintained on pages separate from the tables' data pages.
>Let me ask you this:I can't state categorically that I understand the question...
>
>Suppose that we have the key fields key1, key2, and key3
>
>And I want order by 4th field the key0 descending.
Do you mean you have a composite primary key consisting of three keys?
I do not understand the second part of the question.
>Is the follow index structure correct?You can have a composite ascending index across 3 fields, yes.
>
>Index key1, key2, key3 asc
>Index key0 descYou can have a descending index on one field, yes.
>What about this? (I think that doesn't cover our problem)Which problem is that? I thought it was slowness in a query that was
ordered by a date field in descending order. The suggested answer to
that speed up the *ordering* part of the operation, you needed a
descending index on that field.
>Index key0, key1, key2, key3 descYes. But that index won't be useful unless you need it for something.
>
>All keys in the same index descending putting the key0 first
./heLen