The more queries in Mysql the higher the consumption?

Asked

Viewed 256 times

-2

I’m developing a website and my code is using many queries/queries in Mysql at once, I’m trying to decrease these queries to the smallest number since I think the more queries more resources will be consumed, I’m sure?

Example 1:

$busca = $conexao->query("SELECT nome FROM graficos");
$busca2 = $conexao->query("SELECT nascimento FROM graficos");

Example 2:

$pegadeumavez = $conexao->query("SELECT nome, nascimento FROM graficos");

Would Example 1 have the same consumption as Example 2? I mean any type of consumption as RAM, CPU, bytes, processing, etc

1 answer

-1


good night the idea ai is very simple...the more condesada is your query (ie, the more data you can pick up at once) better, the biggest bottleneck that applications have today is the so-called Server Round Trip, ie the amount gone to the server to pick up data , the less the better. Of course it is up to common sense also not to make a mega consutla that returns a zillion lines, if possible break into small charges. But I answer, yes the more data in a consultation tip the better for the performance of your application.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.