I: Help with indexes/queries/msaccess - Mailing list pgsql-general

From Fabrizio Mazzoni
Subject I: Help with indexes/queries/msaccess
Date
Msg-id 001701c100a1$f9aec640$4f00a8c0@fabrizio
Whole thread Raw
Responses Re: I: Help with indexes/queries/msaccess
List pgsql-general
Hi all...i'm converting an access db to postgres and i have a question on
indexes/queries. The following query, when launched on postgres with the
explain command, isn't using index scans but only sequential scans..why is
this?? I've created all the necessary indexes but the query is very very
slow...
This is the query:
SELECT tAnagraficaGen.*, Clienti.clingua, Clienti.cnote, tZone.tdescr,
tPagamenti.tdescr as ptdescr,
case when tAnagraficaGen.acodage>0 then tAnagraficaGen_1.araso else '' end
AS AgentName
FROM (tPagamenti RIGHT JOIN (tZone RIGHT JOIN (tAnagraficaGen LEFT JOIN
Clienti ON
tAnagraficaGen.aconto = Clienti.cidcliente) ON
tZone.tcod=tAnagraficaGen.azona) ON
tPagamenti.tcod=tAnagraficaGen.acodpag) LEFT JOIN tAnagraficaGen AS
tAnagraficaGen_1 ON
tAnagraficaGen.acodage=tAnagraficaGen_1.aconto;
This is a query generated with access 97 and modified to work on postgres..
The query executed on postgres is much much slower than on access 97..
I was thinking of rewriting it with the "classic" join syntax eg: select *
from a,b where a.a=b.b ...would this partially solve my problem??
Can anyone help me out.?

Thanks in advance..!

fabrizio@macrongolf.com
http://macrongolf.com
http://eteampoint.com
http://macron.com



pgsql-general by date:

Previous
From: "tamsin"
Date:
Subject: RE:
Next
From: Janning Vygen
Date:
Subject: function cache??