9
My question is if using LIMIT
there will be some performance gain in the QUERY
.
Example:
SELECT descricao FROM produto WHERE id = 9999 LIMIT 1
Has better performance than?
SELECT descricao FROM produto WHERE id = 9999
As perhaps it would be generic not specify any tool, I would like replies refente to the best known SQlite
, SQL Server
, PostgreSQL
, MySQL
, Oracle
.
It doesn’t necessarily have to be all of them, but I prefer SQlite
since it runs on mobile devices where performance/optimization is more complex.
Yeah, because it can only return one given line that is the primary key.
– Motta
I understood your doubt, I believe that in any engine the difference is minimal (if there is difference) gain and each engine probably works in a way. I believe that there is no way to answer something specifically for SQL syntax, but only by engine, for example in mysql the engines myIsam and innoDB work in different ways.
– Guilherme Nascimento
I will edit to specify the most used.
– rubStackOverflow
Note that Mysql has different engine types.
– Guilherme Nascimento