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 > Data Access, Manipulation & Batch Languages > Delphi, C etc > Whassup?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-01-03, 08:56
Re.principhia Re.principhia is offline
Registered User
 
Join Date: Apr 2003
Location: Brazil
Posts: 12
Whassup?

I have this Sql statement:


select p.codigo,
p.descricao,
p.conta_corrente,
p.digito_conta,
p.tipo,
f.valor_pagto,
o.tipo as tipo_oper,
s.saldo_ini
from ficadptd p
left join fifluxoc f on f.cod_estab = p.cod_estab and
f.data_baixa >= :data_ini and
f.data_baixa <= :data_fim and
f.situacao = 'Baixado' and
f.portador_pagto = p.codigo
left join fiopefin o on o.codigo = f.oper_financ
left join fiforpag r on r.codigo = f.forma_pagto and
r.flag_deb_cred = 'Sim'
left join fisalptd s on s.cod_estab = p.cod_estab and
s.portador = p.codigo and
s.ano_mes_ref = '200211'
where p.cod_estab = :cod_estab
order by p.codigo


The PLAN that it uses is:

Plan
PLAN SORT (JOIN (JOIN (JOIN (JOIN (P INDEX (RDB$PRIMARY134),F INDEX
(RDB$PRIMARY143,FIFLUXOC_DT_BAIXA_SIT_IDX,FIFLUXOC _PORTADOR_PAGTO_IDX)),O
INDEX (RDB$PRIMARY160)),R INDEX (RDB$PRIMARY144)),S INDEX (RDB$PRIMARY165)))

Adapted Plan
PLAN SORT (JOIN (JOIN (JOIN (JOIN (P INDEX (PK_FICADPTD),F INDEX
(PK_FIFLUXOC,FIFLUXOC_DT_BAIXA_SIT_IDX,FIFLUXOC_PO RTADOR_PAGTO_IDX)),O INDEX
(PK_FIOPEFIN)),R INDEX (PK_FIFORPAG)),S INDEX (PK_FISALPTD)))


The problem: I'm using all the possible index yet but it works very slow!!!
The problem isn't in the prepare time, but in the Execution and Fetch time.
What can I do?

PS. I use IB 6.01


Thanks
__________________
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