Need help to improve the performance of the query

Database
Enthusiast

Need help to improve the performance of the query

please help me to improve the performance of the below query, it is running for nearly 15hrs...

sel columns from
((sel columns from TABLE where conditions) V0300
INNER JOIN
(sel columns from TABLE where conditions) V0200
ON Condition V0300=V0200
LEFT JOIN
(sel columns from TABLE where conditions) V0303
ON Condition V0303=V0300A V0303=V0300A V0303='cc'
INNER JOIN
(sel columns from TABLE where conditions) TX0305
ON Condition TX0305=V0303 TX0305=V0303A TX0305='cc'
LEFT JOIN
(sel columns from TABLE where conditions) AST
ON Condition AST=V0300 AST=V0300 AST='cc'
LEFT JOIN
(sel columns from TABLE where conditions) V0339
ON Condition V0339=V0300 V0339=V0300 V0339='cc'
INNER JOIN
(sel columns from TABLE where conditions)V6016X
ON Condition V6016X=V0300 V6016X=V0300 V6016X='cc'
LEFT JOIN
(sel columns from TABLE where conditions)GLI
ON Condition GLI=V6016X V6016X='cc'

Regards Gowtham
1 REPLY
Enthusiast

Re: Need help to improve the performance of the query

It is very difficult to suggest about performance imrpovement of query without knowing anything about the tables, especially all you are doing is joining bunch of table on some conditions. I can only suggest some generic things like check if you are missing any JOINS/Conditions, check if there is any product join anywhere, check the stats on the tables are accurate etc. I'd suggest, run the explain first and try to find out what is causing this issue.