Among the many forms of development, there was a doubt about what will consume more of my processing between the same operation in different ways ...
If I have a function that can be done directly in my database (a insert
using a select
as a basic example)
Insert into Tabela1(Coluna1,2Coluna,3_coluna) select (select cod from tabela3 where tabela3.nome = tabela2.nome)as 'Coluna1',valorx,valory from Tabela2 Tabela2.cod=z
and the same function can be done through my code
MySqlCommand mySqlCommand_Select = new MySqlCommand("Busca valores tabela2", mySqlConnection);
MySqlCommand mySqlCommand_Select_2 = new MySqlCommand("Busca valores tabela3", mySqlConnection);
//...
//Unir Selects, trabalha os valores etc
//...
MySqlCommand mySqlCommand_insert = new MySqlCommand("Insere os valores tabela1", mySqlConnection);
If the process is the same, is the cost higher for one or the other, or is it the same?
The question includes other operations that can be done directly in the bank and / or code (such as calculations, other queries used as sub or as multiple searches) but it comes down to the cost of 'Outsource' or not these operations for my application