Télefono:
91 626 61 20
Dirección:
C/ Copenhague 6. Edificio Al Andalus. Planta 2ª. Oficina 5. 28232. Las Rozas. Madrid
select ‘update statistics low ‘
, ‘– 1’
from systables t
where t.tabid = 1
union
select ‘update statistics high for table ‘ || trim(tabname) || ‘ (‘ ||
trim(colname) || ‘) distributions only’
, ‘– 2’
from systables t, sysindexes i, syscolumns c
where t.tabid > 99
and t.tabtype = ‘T’
and t.tabid = i.tabid
and t.tabid = c.tabid
and c.colno = i.part1 union
select ‘update statistics medium for table ‘ || trim(tabname) || ‘ (‘ ||
trim(colname) || ‘) distributions only’
, ‘– 3’
from systables t, sysindexes i, syscolumns c
where t.tabid > 99
and t.tabtype = ‘T’
and t.tabid = i.tabid
and t.tabid = c.tabid
and part2 is not null
and c.colno = i.part2
and not exists
(select sysindexes.part1
from sysindexes
where t.tabid = sysindexes.tabid
and c.colno = sysindexes.part1 ) union
……
A partir de aquí habría que hacer lo mismo que la última parte sustituyendo part2 por partN con «2 < N < 17" para obtener cualquier posible indice compuesto de hasta 16 partes que es el máximo especificado.
Se terminaría con
union
select ‘update statistics for procedure’
, ‘– 4’
from systables t
where t.tabid = 1
order by 2;
Este script esta especialmente indicado para aquellos que manejen versiones antiguas de informix o para aquellos que no quieran utilizar los planificadores aparecidos en estas últimas versiones.
Para cualquier información acerca de como sería el script entero o relacionada con el mundo de informix, no dude en consultarnos.