mysql - Which is better in performance client side joins or server side joins -
if have 2 tables employee , department
1) join data @ server side
select * employee cross join department;
we use 1 connection here grab data
2) join data @ client side grab 2 tables , use 2 connections
select * employee;
and store in array , also
select * department;
and store in array , and merge 2 arrays programming @ client side using example javascript.
the second method may more complex advantages store employee table on 1 sever , department table on server decrease load on own server , make each client machine work
but i'm asking if want join 2000 table better in performance , faster: joins @ client side or @ server side?
good question (though bad tags, has been pointed out).
the join faster if done @ server, if each table had 1,000 rows result set 1,000,000 rows, , have sent client. if join @ client, you're sending 2,000 rows. depending on need @ client side, might worth doing separate queries cut down on traffic between client , server. again, joining 2 sets javascript won't fast either.
so here's squishy answer: depends on result set size; you'll have experiment.
note answer holds cross join
only. other join types best done @ server, no question.
Comments
Post a Comment