While reading about tuning SQL queries, I read somewhere that \'Always use table alias and prefix all column names with the aliases when you are using more than one table.\'
I have experience with alias the query take significantly more time compare to without alias.
I have experience this with PostgreSQL, my query are following.
Without Alias
select applicant.application_id, form_data, application_defect.defect_id from applicant INNER JOIN audit_trail on applicant.email = audit_trail.email inner join application_defect on applicant.application_id = application_defect.application_id where application_defect.defect_id like '1%' and form_data like '%FaceApi%' ;
With Alias
select ap.application_id, au.form_data, ad.defect_id from applicant ap INNER JOIN audit_trail au on ap.email = au.email inner join application_defect ad on ap.application_id = ap.application_id where ad.defect_id like '1%' and form_data like '%FaceApi%' ;