mysql - Sql Join taking a lot of time -


i tying execute query taking more 5 hours, data base size 20mb. code. here joining 11 tables reg_id. need columns distinct values. please guide me how rearrange query.

select *   degree  join diploma   on degree.reg_id = diploma.reg_id join further_studies   on diploma.reg_id = further_studies.reg_id join iti   on further_studies.reg_id = iti.reg_id join personal_info   on iti.reg_id = personal_info.reg_id join postgraduation   on personal_info.reg_id = postgraduation.reg_id join puc   on postgraduation.reg_id = puc.reg_id join skills   on puc.reg_id = skills.reg_id join sslc   on skills.reg_id = sslc.reg_id join license   on sslc.reg_id = license.reg_id join passport   on license.reg_id = passport.reg_id group fullname 

please me if did mistake

this bit long comment.

the first problem query using select * group fullname. have zillions of columns in select not in group by. unless really, really, know doing (which doubt), wrong way write query.

your performance problem undoubtedly due cartesian products , lack of indexes. joining across different dimensions -- such skills , degrees. result product of possibilities. people, data size can grow , grow , grow.

and then, question is: have indexes on keys used in joins? performance, want such indexes.


Comments

Popular posts from this blog

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

Making Empty C++ Project: General exception (Exception from HRESULT:0x80131500) Visual Studio Community 2015 -

How to fix java warning for "The value of the local variable is not used " -