Subject | Re: [firebird-support] Re: Query otimization - Why this plan ? |
---|---|
Author | Alexandre Benson Smith |
Post date | 2005-03-15T17:46:22Z |
Hi Set !
Svein Erling Tysvær wrote:
don't know where to put it, I tried on some places but just got errors
("Token unknown line 2 char 17 - on", and some variations of it), the
only place where it works was if I tried the first query with
parenthesis that you suggested.
--
Alexandre Benson Smith
Development
THOR Software e Comercial Ltda.
Santo Andre - Sao Paulo - Brazil
www.thorsoftware.com.br
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.7.3 - Release Date: 15/03/2005
Svein Erling Tysvær wrote:
>Hi Alexandre!:-)
>
>
>I don't know, maybe Arno can tell you.
>
>
>Oh, sure, I always have plenty of ideas. Like you, I don't understandSame plan :-(
>why the optimizer chose the plan it did - other than knowing InterBase
>often made a worse choice than the very best when there was a lot of
>tables to be joined and also wasn't as good with outer joins as with
>inner joins. The crazy changes I would recommend you to try, are
>either
>
>left join Endereco en on (en.EmpresaID = c.EmpresaID+0) ...
>
>
>(it shouldn't help any, but Firebird seems confused and maybe it makessame plan :-(
>it less tempting to use the index it currently uses)
>
>or to experiment with parenthesis, e.g.
>
>select * from (Empresa e
>join Cliente c on e.EmpresaId = c.EmpresaId)
>join SegmentoMercado s on s.SegmentoMercadoId = c.SegmentoMercadoId
>...
>
>
>orerror :-((
>
>select * from Empresa e
>join Cliente (c on e.EmpresaId = c.EmpresaId
>join ListaPreco lp on lp.ListaPrecoId = c.ListaPrecoId + 0)
>join SegmentoMercado s on s.SegmentoMercadoId = c.SegmentoMercadoId
>...
>
>
>As you can see, I'm pretty confused as to where to put the parenthesisI never had used parenthesis to especify the join order either, and even
>(I have never had to do this). Hence, it would be interesting to see
>the result if you find parenthesis any help.
>
>
>
don't know where to put it, I tried on some places but just got errors
("Token unknown line 2 char 17 - on", and some variations of it), the
only place where it works was if I tried the first query with
parenthesis that you suggested.
>HTH,thank you very much for your help !
>Set
>
>
--
Alexandre Benson Smith
Development
THOR Software e Comercial Ltda.
Santo Andre - Sao Paulo - Brazil
www.thorsoftware.com.br
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.7.3 - Release Date: 15/03/2005