![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
|
In article <fle19n011r2 (AT) drn (DOT) newsguy.com>, dcruncher4 (AT) aim (DOT) 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. 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. |
#2
| |||
| |||
|
|
In article <fle19n011r2 (AT) drn (DOT) newsguy.com>, dcruncher4 (AT) aim (DOT) 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. |
|
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. |
|
_______________________________________________ Informix-list mailing list Informix-list (AT) iiug (DOT) org http://www.iiug.org/mailman/listinfo/informix-list |
#3
| |||
| |||
|
|
I am using IDS 7.31 Consider this table (col1 integer, col2 datetime, col3 integer, ... other columns ) pky = col1 + col2 + col3 The problem is that the design of this table is bit odd. Everytime a change is made to a row of this table, a new row is created with a new timestamp (col2 in this case) and rest of the columns remain same, except the one which changed. Obviously active row is considered as something with the greatest col2 for a combo of col1+col3. An appropriate view was declared to show only the most active row create view aaa as select col1,col3,col4 ...., (select max(col2) from table t2 where t2.col1 = t1.col1 and t2.col3 = t1.col3) from table t1 The performance of this query wasn't good on large set of data. I then decided to try this 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. |
|
TIA. _______________________________________________ Informix-list mailing list Informix-list (AT) iiug (DOT) org http://www.iiug.org/mailman/listinfo/informix-list |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |