You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
whit this query
"update full_combin_random c set c.utilise=1 where http://c.ID in (select http://a.ID from full_combin_random a inner join full_combin b on
b.utilise=1 and
a.A=b.A and
a.B=b.B and
a.C=b.C and
a.D=b.D and
a.E=b.E and
a.F=b.F);"
or
"select c.* from full_combin_random c where http://c.ID in (select http://a.ID from full_combin_random a inner join full_combin b on
b.utilise=1 and
a.A=b.A and
a.B=b.B and
a.C=b.C and
a.D=b.D and
a.E=b.E and
a.F=b.F);"
i have a infinity loop !
the table "full_combin_randon" contains + - 8000000 million rows,
the table "full_combin" same thing.
the two tables are indexed on fields (a, b, c, d, e, f) and (utilise).
the processor goes up to 99%.
I let the query run two days without results.
The text was updated successfully, but these errors were encountered:
This is not a engine bug or direct problem, it is simply a poorly written query and/or missing indexes.
Your queries is resulting in 8,000,000^2 rows being read!!!!
The more optimal version of the query would be:
update full_combin_random c set
c.utilise=1
where
EXISTS(
SELECT 1
from full_combin_random a
inner join full_combin b on (
b.utilise=1 and
a.A=b.A and
a.B=b.B and
a.C=b.C and
a.D=b.D and
a.E=b.E and
a.F=b.F
)
WHERE http://a.ID = http://c.ID
)
The query performance is affected by the use of the IN() instead of EXISTS() and whether there is a compound index A+B+C+D+E+F+utilise on the full_combin table.
Submitted by: Daniel (danielv8888)
Votes: 1
whit this query
"update full_combin_random c set c.utilise=1 where
http://c.ID in (select http://a.ID from full_combin_random a inner join full_combin b on
b.utilise=1 and
a.A=b.A and
a.B=b.B and
a.C=b.C and
a.D=b.D and
a.E=b.E and
a.F=b.F);"
or
"select c.* from full_combin_random c where
http://c.ID in (select http://a.ID from full_combin_random a inner join full_combin b on
b.utilise=1 and
a.A=b.A and
a.B=b.B and
a.C=b.C and
a.D=b.D and
a.E=b.E and
a.F=b.F);"
i have a infinity loop !
the table "full_combin_randon" contains + - 8000000 million rows,
the table "full_combin" same thing.
the two tables are indexed on fields (a, b, c, d, e, f) and (utilise).
the processor goes up to 99%.
I let the query run two days without results.
The text was updated successfully, but these errors were encountered: