You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-user@db.apache.org by Alexandru Dovlecel <al...@siemens.com> on 2004/04/09 11:00:19 UTC

JOIN vs WHERE

Hi all,

Question: does the Torque generate queries with JOIN??? Or when it cames to
joining tables, it creates an where clause???

AFAIK, if generating where clauses instead of joins, IT COULD LEAD to
performance problems. Using JOIN is recommended instead of plain where
clauses. Am I right? In case of large tables (lots of data), a couple of
where clauses to join some tables would slow down the application quite
allot.

Pls correct me if I am wrong. Better to find out now that I am wrong than
having wrong ideas in my mind.

10q,
Alex


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


Re: JOIN vs WHERE

Posted by Andras Balogh <an...@reea.net>.
    Hello Alexandru,

    Torque does support join by using criteria.addJoin().
What is  not supported (as far as i know) to specify the join type 
(left, right etc.)
The Sql that is generated is something like:
select * from table1,table2 where table1.id= table2.other_id
    This will be interpreted by the Database as a inner join.

Best wishes,
Andras.

PS. Happy Easter!
 (Paste Fericit!:))


Alexandru Dovlecel wrote:

>Hi all,
>
>Question: does the Torque generate queries with JOIN??? Or when it cames to
>joining tables, it creates an where clause???
>
>AFAIK, if generating where clauses instead of joins, IT COULD LEAD to
>performance problems. Using JOIN is recommended instead of plain where
>clauses. Am I right? In case of large tables (lots of data), a couple of
>where clauses to join some tables would slow down the application quite
>allot.
>
>Pls correct me if I am wrong. Better to find out now that I am wrong than
>having wrong ideas in my mind.
>
>10q,
>Alex
>
>
>---------------------------------------------------------------------
>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


Re: JOIN vs WHERE

Posted by Florian Fray <fl...@compuserve.de>.
Hi Alexandru,

Torque does neither support explicit inner joins in the form
JOIN x ON x.id = y.fk nor left nor right joins.
Im currently working on this feature.
I've done it two weeks ago for my company but I have to rewrite it before
contributing the code.
So if you can be patient for a few days ...

Happy Eastern to all of you.

F. Fray
Wuppertal, Germany

----- Original Message ----- 
From: "Alexandru Dovlecel" <al...@siemens.com>
To: "'Apache Torque Users List'" <to...@db.apache.org>
Sent: Friday, April 09, 2004 11:00 AM
Subject: JOIN vs WHERE


> Hi all,
>
> Question: does the Torque generate queries with JOIN??? Or when it cames
to
> joining tables, it creates an where clause???
>
> AFAIK, if generating where clauses instead of joins, IT COULD LEAD to
> performance problems. Using JOIN is recommended instead of plain where
> clauses. Am I right? In case of large tables (lots of data), a couple of
> where clauses to join some tables would slow down the application quite
> allot.
>
> Pls correct me if I am wrong. Better to find out now that I am wrong than
> having wrong ideas in my mind.
>
> 10q,
> Alex
>
>
> ---------------------------------------------------------------------
> 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


Re: JOIN vs WHERE

Posted by Florin Vancea <fv...@maxiq.ro>.
(Hi Alex! How are you lately?)

Maybe it's a vendor-related issue. For example Oracle gets away very well
with WHERE (actually I cannot tell if there's a way to support JOIN, at
least not in older releases...)

IMHO, the DB should figure its way offering the same level of performance,
either when using JOIN or WHERE, as long as they are both supported in the
first place. But then maybe this is only common sense and not supported by
some standard I did not bother to read.

Florin

----- Original Message ----- 
From: "Alexandru Dovlecel" <al...@siemens.com>
To: "'Apache Torque Users List'" <to...@db.apache.org>
Sent: Friday, April 09, 2004 12:00 PM
Subject: JOIN vs WHERE


> Hi all,
>
> Question: does the Torque generate queries with JOIN??? Or when it cames
to
> joining tables, it creates an where clause???
>
> AFAIK, if generating where clauses instead of joins, IT COULD LEAD to
> performance problems. Using JOIN is recommended instead of plain where
> clauses. Am I right? In case of large tables (lots of data), a couple of
> where clauses to join some tables would slow down the application quite
> allot.
>
> Pls correct me if I am wrong. Better to find out now that I am wrong than
> having wrong ideas in my mind.
>
> 10q,
> Alex
>
>
> ---------------------------------------------------------------------
> 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