Subject | Re: [firebird-support] Bad join plan in 2.0.1, why? |
---|---|
Author | Alexandre Benson Smith |
Post date | 2007-06-28T23:02:31Z |
Jorge Andres Brugger wrote:
message ?
Do you have indices defined for:
Items_Factura.Codigo_Producto
Facturas.Fecha
?
If not, define it, I hope it would improve a lot your query.
indexed and doesn't help, I think it's strange.
Try to set the indices statistics of all indices on the two tables.
--
Alexandre Benson Smith
Development
THOR Software e Comercial Ltda
Santo Andre - Sao Paulo - Brazil
www.thorsoftware.com.br
> Alexandre:What is the plan for this single query ? The one you sent on the first
>
> Thanks for your answer.
>
> Really, what I do later is:
>
> select sum(cantidad) from vw_items_facturas_no_anuladas where sucursal = 1
> and fecha > '2007-04-30' and codigo_producto = 31344
>
message ?
Do you have indices defined for:
Items_Factura.Codigo_Producto
Facturas.Fecha
?
If not, define it, I hope it would improve a lot your query.
> (called from inside SP).Strange, what the plan before and after adding that index ? The same ?
>
> It tooks aprox 15 secs for each "codigo_producto", and I've about 35000 ...
> so it takes too much.
>
> Adding a fecha index doesnt make it faster.
>
> If you have some other suggestion, I'll glad to read them.My suggestion is to add the two indices above, you told me Fecha was
>
indexed and doesn't help, I think it's strange.
Try to set the indices statistics of all indices on the two tables.
> Regardssee you !
>
--
Alexandre Benson Smith
Development
THOR Software e Comercial Ltda
Santo Andre - Sao Paulo - Brazil
www.thorsoftware.com.br