From: | Francisco Reyes <lists(at)natserv(dot)com> |
---|---|
To: | Luz Lopez <viaris(at)hotmail(dot)com> |
Cc: | pgsql-novice(at)postgresql(dot)org |
Subject: | Re: Query very slow |
Date: | 2001-11-10 19:45:33 |
Message-ID: | 20011110144251.Y37050-100000@zoraida.natserv.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-novice |
On Sat, 10 Nov 2001, Luz Lopez wrote:
> I have a query that the excution es very slow, my query is:
>
> "select count(B.fil) as juntas,
sum(C.column1),sum(C.column2),
sum(C.column3),sum(C.column4),
sum(C.column5,sum(C.column6)from table1 B, table2 C
where C.tipo=1 and B.codigo=15 and C.fil=B.fil"
>
> The main table have 37824 rows nad I have index for the two tables.
>
> How can I to improve better execution time at this query?
How about if you show us the output from "explain".
Also you did not specify what you had the indexes on.
Which is the main table? You are using 3 tables on this query.
From | Date | Subject | |
---|---|---|---|
Next Message | Francisco Reyes | 2001-11-10 20:18:57 | Re: SQL Question |
Previous Message | Francisco Reyes | 2001-11-10 19:42:42 | Re: SQL Question |