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 ---------------------------(end of broadcast)--------------------------- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]