Re: an index question
Posted in 2008
Topics: Performance & Tuning, Triggers, Constraints & Referential Integrity
dcruncher4@aim.com wrote:
> In article <fle19n011r2@drn.newsguy.com>, dcruncher4@aim.com says...
>
>> create index aaaa on table(col1 asc, col2 desc, col3 asc)>>
>> The performance gain on the view was incredible.
>> What can be the reason behind it. Can anyone explain
>> the internals behind it.
>>
>> The only problem I see is that with this index I can not
>> create a PKY or a unique constraint, and for that I am
>> forced to create another index.
>>
>
> I take it back. PKY can be created on an index with
> desc columns but not as part of create table syntax.
> Index has to be created first explicitly and then
> PKY should be created. IDS will use the same
> index.
>
Correct.
> Does that mean that there is some sort of a bug
> here because one way of creating PKY allows
> desc index to be used, while the other one does
> not.
>
Not a bug. Likely just a design decision. The Primary Key syntax
doesn't allow for specifying the order of each column whether it's
within the CREATE TABLE statement or outside it. You can only use a
partially or wholly descending index for a primary key by creating the
index first.
Art S. Kagel
> _______________________________________________
> Informix-list mailing list
> Informix-list@iiug.org
> http://www.iiug.org/mailman/listinfo/informix-list
>
>