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

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -