Thanks Omi. I will give it a try.
Also will it possible for me put filters on table 1(say Employees) and then perform join with other tables? On Feb 9, 7:34 pm, Omi Chiba <[email protected]> wrote: > Sound like you're looping all the records to connect different table. > I use join for the purpose and working fine though I only have about > 10000 records. > > http://www.web2py.com/books/default/chapter/29/6?search=join#Inner-joins > > On Feb 9, 8:19 am, Sonal_b <[email protected]> wrote: > > > > > > > > > I have to query 3tableswhich contains large number ofdata > > > I have to come up with report which displays > > > Employee Firstname, Lastname, Manager's FirstName, Manager's Lastname > > and Organisation name. > > > Table Structure/Details: > > > 1. Employee table: which contains employee information(First name, > > lastname), Organisation id and manager's id. > > 2. Manager Table: Which contains firstname, lastname etc. > > 3. Organisation table: which contains organisation's name. > > > The process i follow is: > > 1.Fetchall the employees > > 1.a for each employee get the manager id > > 1.b For the manager id get the manager's firstname and > > lastname by querying the Manager table > > 1.c for each employee get the organisation id > > 1.d For each organisation id get the Organisation name by > > querying the Organisation table. > > > When I try tofetchthe records from 3tablesfollowing the above > > approach, I get deadlineexceedederror as my request could not complete > > in 30 seconds time. > > > Please suggest a betterwayto do this. Also what should i use which > > can improve performance and also get me the result in the 30 second > > timeframe.

