pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Linh Luong <linh.luong@computalog.com>
To: pgsql-sql@postgresql.org
Subject: Too many rows returning
Date: Wed, 30 May 2001 17:33:14 -0600
Message-ID: <3B15833A.393513A8@computalog.com> (raw)

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



Message-ID: <3B15833A.393513A8@computalog.com>
Permalink:  ../3B15833A.393513A8@computalog.com/
Also on:    postgresql.org/message-id/3B15833A.393513A8@computalog.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: linh.luong@computalog.com
  Subject: Re: Too many rows returning
  In-Reply-To: <3B15833A.393513A8@computalog.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox