|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
||||
|
||||
|
My question is meant to be performance oriented.
Suppose we have this table A _________ int id; varchar price; and table B ___________ int id; int language_flag; varchar description; id in B is foreign key in A. We want to retrieve for two given id and language_flag a single row like this: id, price, description I could join A and B on (A.id = B.id) selecting the right language with a WHERE, but I could also extract the price and, with a second query, the description. Which one would perform best? See you and thanks. |
|
#2
|
|||
|
|||
|
It will always be faster to the the db do the join, also the lesser number of queries the less overhead necessary to parse, execute and fetch.
|
|
#3
|
||||
|
||||
|
ok, thanks
![]() |
![]() |
| Viewing: Dev Shed Forums > Databases > Database Management > Join vs two queries |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|