Considering the two forms of joining tables with a join
(any):
SELECT Tabela.A, Tabela.B, Tabela2.C
FROM Tabela
LEFT JOIN Tabela2 ON Tabela.Id = Tabela2.TabelaId
And a union using from
SELECT Tabela.A, Tabela.B, Tabela2.C
FROM Tabela, Tabela2
WHERE Tabela.Id = Tabela2.TabelaId
Since the data to be returned is the same.
In one of the querys that run in my application, when using union through from
instead of join
the performance difference is very high.
- Marriage with from: 8s
- Join Join: 0.2s
What is the difference between these unions? When to use one instead of the other?