Too many rows returning

From: Linh Luong <linh(dot)luong(at)computalog(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Too many rows returning
Date: 2001-05-30 23:33:14
Message-ID: 3B15833A.393513A8@computalog.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi,

Does the number of rows affect how long it takes to execute a query.

I have 3 UNIONS.
One table has 97 rows, another has 7375 rows, and 1558;
In each union there are at least one LEFT OUTER JOIN and each subselect
has at least 2 JOINed tables.

Something like this:
select ..,..,,...,.
from
(subselect. ...
) as T1
LEFT JOIN
(subselect ...
) as T2
on T1.field1=T2.field2

UNION

select ..,..,,...,.
from
((subselect. ...) as T1 LEFT JOIN
(subselect ....) as T2 on T1.field1=T2.field1) as T3
LEFT JOIN
(subselect ...
) as T2
on T1.field1=T2.field2

UNION

select ..,..,,...,.
from
(subselect. ...
) as T1
LEFT JOIN
(subselect ...
) as T2
on T1.field1=T2.field2

When I do my sql stmt it takes more than 10minutes to return and
sometimes it display the maximum 30 sec has exceed...

Can anyone provide any suggestion in how I can speed up the execution
and possibly return something to me without the error message.

I have tried index but it doesn't seem to have an affect.. because I did
the explain it still using seq scan.. (re: last post "using indexes")

Thanks again

Linh

Browse pgsql-sql by date

  From Date Subject
Next Message Sergey E. Volkov 2001-05-31 07:54:40 Re: SELECT * INTO TABLE is not working for me.
Previous Message Chris Ruprecht 2001-05-30 23:11:26 Re: Unique record Identifier?