db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Greg Monroe" <Greg.Mon...@DukeCE.com>
Subject RE: Joins in torque (slightly Off Topic)
Date Fri, 20 Jan 2006 15:23:53 GMT
Haven't used it but have heard DB Solo can do execution
plans for many DB's.  http://www.dbsolo.com/

Squirrel-SQL (Open source) might have a plug-in to do 
this, but I'm not sure. http://squirrelsql.org/

Check the MySQL manuals for query optimization chapters.

Oh, BTW, if you set up your log4j options so that Torque
is using the debug level, the debug log will have queries
and execution times.  Nice way to scan for slow queries
that need optimizing and to verify that your criteria
is doing the right thing.

> -----Original Message-----
> From: Alvaro Coronel [mailto:alvarocoronel67@yahoo.com] 
> Sent: Friday, January 20, 2006 7:16 AM
> To: Apache Torque Users List
> Subject: RE: Joins in torque (slightly Off Topic)
> 
> 
> Can you recommend a tool like MS Query Analyzer for MySQL
>   
>   Thx!
>   
>   Álvaro
> 
> Greg Monroe <Greg.Monroe@DukeCE.com> wrote:  An alternate 
> thought is to just create a view in the database (MySQL V5 
> supports them) and then do a 
> psuedo table in the XML to generate the required
> classes.
> 
> You probably already know this, but when you're 
> doing complex joins like this, pay close attention
> to what needs to be indexed.  Without the right
> indices, a large join query against a large number
> of records can grind your app to a halt. I tend to 
> spend some time in a Query Analyzer type tool 
> (e.g. MS SQL's Query Analyzer...lol) to optimize 
> any complex queries that underlie views.
> 
> > -----Original Message-----
> > From: Stephan Spiegel [mailto:spiegel@szwo.de]
> > Sent: Thursday, January 19, 2006 11:17 AM
> > To: torque-user@db.apache.org
> > Subject: Joins in torque
> > 
> > 
> > Hi, (in case this message is double please excuse me)
> > 
> > I really do not understand what to do, I do not get the
> > expected results!
> > 
> > Let´s say I have 3 Tables: T1, T2 and T1_2
> > T1:
> > ID (integer pk)
> > value (varchar)
> > ...
> > 
> > T2:
> > ID (integer pk)
> > value (varchar)
> > ...
> > 
> > T1_2:
> > T1_ID (integer fk->T1)
> > T2_ID (integer fk->T2)
> > 
> > As a result, I would like to have a union table showing the
> > values of T1 and T2 in SQL this would be: select T1.value, 
> > T2.value from T1, T2, T1_2 where T1.ID = T1_2.T1_ID and T2.ID 
> > = T1_2.T2_ID
> > 
> > if I get more than this (select * ...) would be fine as well.
> > 
> > So, I have my classes but when I try to use them as written
> > in Peers HowTo
> > (doSelectJoin...) or in Criteria HowTo (crit.addJoin(...)) I 
> > always get only the values of the T1_2-table
> > 
> > As a first step, I try just to get the first half (result
> > should show: T1.value, T1_2.T2_ID) so it should correspond to:
> > doSelectJoinT1(crit) in T1_2Peer
> > or:
> > crit.addJoin(T1.ID,T1_2.T1_ID,Criteria.LEFT_JOIN)
> > 
> > as a result I just get the T1_2 values. I checked the
> > mailing-list-archives, I can´t find a helpful message. Where 
> > is my mistake? Could somebody tell me exactly how to add this join?
> > 
> > (I´m using torque-3.2, MySQL 5, defaultidMethod=native)
> > 
> > thanks in advance, Stephan
> > 
> > 
> > 
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> > For additional commands, e-mail: torque-user-help@db.apache.org
> > 
> > 
> 
> Duke CE Privacy Statement
> Please  be advised that this e-mail and any files transmitted 
> with it are  confidential communication or may otherwise be 
> privileged or  confidential and are intended solely for the 
> individual or entity to  whom they are addressed. If you are 
> not the intended recipient you may  not rely on the contents 
> of this email or any attachments, and we ask  that you please 
> not read, copy or retransmit this communication, but  reply 
> to the sender and destroy the email, its contents, and all 
> copies  thereof immediately. Any unauthorized dissemination, 
> distribution or  copying of this communication is strictly prohibited.
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org
> 
> 
> 
> 
> 		
> ---------------------------------
>  Yahoo! Autos. Looking for a sweet ride? Get pricing, 
> reviews, & more on new and used cars.
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Mime
View raw message