aspose file tools*
The moose likes Performance and the fly likes which one is effecient Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Performance
Bookmark "which one is effecient " Watch "which one is effecient " New topic
Author

which one is effecient

Daniel Sagayaraj
Ranch Hand

Joined: Mar 15, 2010
Posts: 32
both querys returns the same result set....

all i want to know is ..... which one is effecient when there is volume of the data exceds 1 lac



select
lo.loc_name,
d.dispense_date,
p.patient_id,
p.patient_last_name,
a.prod_name,
s.lot,
s.expiry_date,
d.physician,
d.notes
from
lp_manage_patient as p,
rfx_ent_products as a,
lp_dispense as d,
lp_serial as s,
rfx_ent_locations as lo
where
d.manage_patient_id = p.manage_patient_id
and
d.product_id = a.prod_id
and
d.serial_id = s.serial_number
and
lo.location_id=p.location_id;


----------------------------------------------------------------------

select
lo.loc_name,
d.dispense_date,
p.patient_id,
p.patient_last_name,
a.prod_name,
s.lot,
s.expiry_date,
d.physician,
d.notes
from lp_manage_patient as p
inner join lp_dispense as d on d.manage_patient_id = p.manage_patient_id
inner join rfx_ent_products as a on d.product_id = a.prod_id
inner join lp_serial as s on d.serial_id = s.serial_number
inner join rfx_ent_locations as lo on lo.location_id=p.location_id;
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

if your database supports it, try using 'explain' and see which gives the lower cost.
'explain' is as simple as copying the queries as you have them below, but add the word 'explain' at the start.

eg
explain select * from lp_manage_patient
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: which one is effecient