Return-Path: Delivered-To: apmail-db-torque-user-archive@www.apache.org Received: (qmail 1872 invoked from network); 27 Nov 2003 08:21:56 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 27 Nov 2003 08:21:56 -0000 Received: (qmail 63155 invoked by uid 500); 27 Nov 2003 08:21:31 -0000 Delivered-To: apmail-db-torque-user-archive@db.apache.org Received: (qmail 62882 invoked by uid 500); 27 Nov 2003 08:21:29 -0000 Mailing-List: contact torque-user-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Apache Torque Users List" Reply-To: "Apache Torque Users List" Delivered-To: mailing list torque-user@db.apache.org Received: (qmail 62869 invoked from network); 27 Nov 2003 08:21:29 -0000 Received: from unknown (HELO s5.supplehost.com) (64.90.182.98) by daedalus.apache.org with SMTP; 27 Nov 2003 08:21:29 -0000 Received: from joshholtzman.com (c-67-169-157-102.client.comcast.net [67.169.157.102]) by s5.supplehost.com (8.12.10/8.12.9) with ESMTP id hAR8Lec3014995 for ; Thu, 27 Nov 2003 03:21:40 -0500 Message-ID: <3FC5B410.3020507@joshholtzman.com> Date: Thu, 27 Nov 2003 00:21:36 -0800 From: Josh Holtzman User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4.1) Gecko/20031008 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Apache Torque Users List Subject: Re: Performance problems References: <3FC59C01.9080605@joshholtzman.com> <3FC5AE6C.8020801@reea.net> In-Reply-To: <3FC5AE6C.8020801@reea.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Thanks Andras. I thought about doing joins, but I run into this problem: Not all accounts have an assignment. I still want to show the accounts with no assignments, and the join keeps any account without an assignment out of the results. I will look into creating a view, but I'm not sure how I can create a torque object that maps to a view rather than a table. Are there any references for how to do this? Thanks again for your help! Josh Andras Balogh wrote: > Hello Josh, > > What happens is the torque loads each object (if its doesn't have > it already ) from the DB. > You should try to use the methods doSelectJoin .... to tell torque > that make a join in the tables > and load all objects form one shoot, or i think better is to make your > own method > doSelectAccountJoinByJobsJoinByCategory :). > Another way would be to create a view in your DB that contains all > info you need to display and generate for that aslo > torque classes. This will work olny if you read the info only (i.e. a > report on screen or something like that) > but not making modfications (insert/update/delete) beacause i don't > know how these works on views. > > Best wishes, > Andras. > > > > Josh Holtzman wrote: > >> I'm using torque in a webapp, and I'm seeing really slow performance >> when I try to get data from "nested" objects. Here's what I mean: >> >> I have a torque object named Account. An account can have several >> Assignments, which is another torque object. An assignment can have >> Jobs (yup -- another torque object) and a Job can have a Category >> (yet another torque object). Due to the amount of data stored in >> each of these, they must be separate objects (I'm trying to avoid >> eliciting the obvious solution "put all of that info in one object" >> suggestion). >> >> I grab a list of accounts in my servlet with a doSelect(criteria) and >> send them to a JSP to be displayed (I'm using struts, but that's >> beside the point). If I ask the JSP to just display info in the >> Account object, everything runs quickly. If I ask the JSP to get the >> Account's Assignments and display info from the Assignments, it slows >> down a bit. Once I ask for Job or category info, it grinds to a crawl. >> >> I'm wondering what's going on when I ask the JSP to >> account.getAssignments(). Is the JSP hitting the database in order >> to instantiate the account's assignments? I would think that when I >> instantiated the Account, all of its own internal objects (the >> assignments, the jobs, the categories) would also be instantiated. >> So why then the huge performance hit? >> >> I know that I am missing something here, so please, all of you Torque >> gurus, let me know where young grasshopper has strayed from the >> path. And if I need to provide more details (code, etc), I can do >> that too. >> >> Thanks so much, >> Josh >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org >> For additional commands, e-mail: torque-user-help@db.apache.org >> > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org > For additional commands, e-mail: torque-user-help@db.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org For additional commands, e-mail: torque-user-help@db.apache.org