SQL query results with limit are different each time, indicating that the data results are in a different order each time. Does this mean that even if limit = 1 is set, the full table results will be read first and then intercepted based on the limit value? This means that a query with limit = 1 or limit = 10000 takes almost the same amount of time.
jie
Asked on Sep 13, 2022
limit
in an SQL query without an order by
clause is non-deterministic by nature.limit
without order by
, the query may not scan the full table; it may early exit instead.limit
without order by
is non-deterministic, meaning it may vary each time the query is executed.