Subject Re: Problem with query with ORDER BY DESC
Author Sandro Silveira
Hi Aage,

I use the plan TT_CHA_DESC, if i use the plan TT_CHA in ascending
order works ok, but if use TT_CHA_DESC the result is very slow for my
application.


Thanks,

Sandro.

--- In ib-support@yahoogroups.com, Aage Johansen <aagjohan@o...>
wrote:
> Sandro wrote:
> -----------------
> ...
> CREATE INDEX TT_CDP ON TTALAO(TT_SIG, TT_DTP, TT_CCU);
> CREATE INDEX TT_CDR ON TTALAO(TT_SIG, TT_DTR, TT_CCU);
> CREATE INDEX TT_CHT ON TTALAO(TT_SIG, TT_TAL, TT_CCU);
> CREATE UNIQUE INDEX TT_CFR ON TTALAO(TT_SIG, TT_FBR, TT_LOT,
TT_PRG,
> TT_TAL, TT_CCU);
> CREATE UNIQUE INDEX TT_CHA ON TTALAO(TT_SIG, TT_PED, TT_LOT,
TT_PRG,
> TT_TAL, TT_CCU);
> CREATE UNIQUE INDEX TT_CHL ON TTALAO(TT_SIG, TT_LOT, TT_PRG,
TT_TAL, TT_CCU);
> CREATE UNIQUE INDEX TT_CHP ON TTALAO(TT_SIG, TT_PRG, TT_LOT,
TT_TAL, TT_CCU);
> CREATE UNIQUE INDEX TT_CPE ON TTALAO(TT_SIG, TT_LOT, TT_PED,
TT_PRG,
> TT_TAL, TT_CCU);
> CREATE UNIQUE INDEX TT_CPF ON TTALAO(TT_SIG, TT_FBP, TT_LOT,
TT_PRG,
> TT_TAL, TT_CCU);
> CREATE UNIQUE INDEX TT_CPL ON TTALAO(TT_SIG, TT_DTP, TT_LOT,
TT_PRG,
> TT_TAL, TT_CCU);
> CREATE UNIQUE INDEX TT_CPR ON TTALAO(TT_SIG, TT_PRO, TT_LOT,
TT_PRG,
> TT_TAL, TT_CCU);
> CREATE UNIQUE INDEX TT_CRL ON TTALAO(TT_SIG, TT_DTR, TT_LOT,
TT_PRG,
> TT_TAL, TT_CCU);
> CREATE UNIQUE DESCENDING INDEX TT_CHA_DESC ON TTALAO(TT_SIG,
TT_PED,
> TT_LOT, TT_PRG, TT_TAL, TT_CCU);
> ...
> --------------------
>
> What is the PLANs used?
> You have all indexes starting with the same field (TT_SIG) - this
used to
> confuse the IB optimizer, maybe this still holds true for Fb
1.0.2.908?
>
> --
> Aage J.