How can one indicate the maximum number of result records that should be returned in an SQL string?
E.g. when a DB table containing 5000000 records is read out with an SQL query, the WHERE clause can filter the number of records, but can return up to 5M records. Is it possible to indicate in the SQL query the maximum number of records that should be returned to optimize performance?
Is it really neccessary to say "if you want the right result" in every posting?
So, the answer to every tuning question is:
SELECT 1 FROM DUAL;
It's very fast, there's no disk activity and it's the shortest select statement I can think of.
On the other hand it might not be the result you want!
"The power of instruction is seldom of much efficacy except in those happy dispositions where it is almost superfluous" - Gibbon, quoted by R.P.Feynman