I created indexing in my tables, and then I run the same queries using two different methods: I run these queries on MySql, but always get a different runtime, sometimes faster at first, and sometimes the second. That's why I want expert opinion on this .Queries is First -
select t1.field
from table1 as t1
where t1.field in (
select t2.field
from table2 as t2
where t2.field in (
select t3.field from table3 as t3
where t3.field='something'))
And Second using join as
select t1.field
from table1 as t1,
table2 as t2,
table3 as t3
where t1.field = t2.field
and t2.field = t3.field
and t3.field='something'
So can someone tell me what will give me high performance and why, since my database is too big ... So I wanted to know which one is better to write such queries in MySql.
source
share