Skip site navigation (1) Skip section navigation (2)

Re: Query very slow

From: "Luz Lopez" <viaris(at)hotmail(dot)com>
To: lists(at)natserv(dot)com
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Query very slow
Date: 2001-11-12 15:28:49
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
Sorry I forgot to show the tables and indexes.

Table1               table2
fil int              fil int
tipo int             codigo int
column1 int          descripcion vachar(120)
column2 int          descripcion1 varchar(120)
column3 int
column4 int
column5 int
column6 int

The indexes is for table1 tabl_idx1(fil,tipo), tab1_idx2(fil) for table2 is 
tab2_idx1(fil), tab2_idx2(fil,codigo)

Thanks in advanced,

> > 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.

Get your FREE download of MSN Explorer at

pgsql-novice by date

Next:From: amp Date: 2001-11-12 16:04:54
Previous:From: Honza RudovskyDate: 2001-11-12 15:22:48
Subject: PLPGSQL Installation

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group