ipineda
15th February 2011, 19:36
Hi friends,
In software develoment one of the most common tasks is to join tables, in Baan there are different ways to do this. I will show the ways i know using some examples.
Number 1 (using refers to):
select tcibd100.*, tcibd001.cuni
from tcibd100 , tcibd001
where tcibd100._index1 = {:i.item}
and tcibd100.item refers to tcibd001
selectdo
|* Some process
endselect
Number 2 (using fields)
select tcibd100.*, tcibd001.cuni
from tcibd100 , tcibd001
where tcibd100._index1 = {:i.item}
and tcibd001.item = tcibd100.item
selectdo
|* Some process
endselect
Number 3 (using selectdo)
select tcibd100.*
from tcibd100
where tcibd100._index1 = {:i.item}
selectdo
select tcibd001.cuni
from tcibd001
where tcibd001._index1 = {:tcib100.item}
selectdo
|* Some process
endselect
endselect
My question is.....is there a performance difference between these options? and if yes which one is the best (faster)?
In my case i'm having performance problems with some queries thats why i want to kwon which one is the best option, if there is another way plese make me kwon.
Thanks for your help.
In software develoment one of the most common tasks is to join tables, in Baan there are different ways to do this. I will show the ways i know using some examples.
Number 1 (using refers to):
select tcibd100.*, tcibd001.cuni
from tcibd100 , tcibd001
where tcibd100._index1 = {:i.item}
and tcibd100.item refers to tcibd001
selectdo
|* Some process
endselect
Number 2 (using fields)
select tcibd100.*, tcibd001.cuni
from tcibd100 , tcibd001
where tcibd100._index1 = {:i.item}
and tcibd001.item = tcibd100.item
selectdo
|* Some process
endselect
Number 3 (using selectdo)
select tcibd100.*
from tcibd100
where tcibd100._index1 = {:i.item}
selectdo
select tcibd001.cuni
from tcibd001
where tcibd001._index1 = {:tcib100.item}
selectdo
|* Some process
endselect
endselect
My question is.....is there a performance difference between these options? and if yes which one is the best (faster)?
In my case i'm having performance problems with some queries thats why i want to kwon which one is the best option, if there is another way plese make me kwon.
Thanks for your help.