If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Other > Interbase - URGENT!!!

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-16-03, 08:49
Re.principhia Re.principhia is offline
Registered User
 
Join Date: Apr 2003
Location: Brazil
Posts: 12
Question Interbase - URGENT!!!

I have a table with 240000 registers. This table is "fifluxoc"

If have these indexes for this table:

RDB$PRIMARY143 on fields "cod_estab,registro"

FIFLUXOC_ESTAB_DT_BAIXA_SIT_IDX on fields "COD_ESTAB,DATA_BAIXA,SITUACAO"

FIFLUXOC_ESTAB_DT_PREV_SIT_IDX on fileds "COD_ESTAB,DATA_PREVISTA,SITUACAO"

When I do this select:

select *
from fifluxoc
where cod_estab = :cod_estab_par and
registro = :registro_par

It is very slow, because they use the index FIFLUXOC_ESTAB_DT_PREV_SIT_IDX instead the PRIMARY KEY thai is the perfect index for this query.

So, I do this:

select *
from fifluxoc
where cod_estab = :cod_estab_par and
registro = :registro_par
PLAN( fifluxoc INDEX(RDB$PRIMARY143) )

In this time, it works very fast!!! Because I force the use of the correct index on the PLAN. But I cannot do it because if I do a backup-restore in my database the name "RDB$PRIMARY143" will be changed.

Why don't my query change the more approprieted index for the select? Why does it always select the FIFLUXOC_ESTAB_DT_PREV_SIT_IDX for all the querys? How can I do???

Thanks

regards,
__________________
Renata Fernanda Andreatti
renata@principhia.com.br
PRINCIPHIA - Comércio de Informática Ltda.
(011) 4582-9267
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On