You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One of the purposes of entity.get() is to detect MultipleObjectsFoundError. If you add limit 2 to SQL queries, SQL server can use less resources while executing the query. For example, SQL server can stop populating internal cache if only two records needed. Yes I know that we may use cursors, but still sure that limit 2 will not hurt in performance in any way.
The text was updated successfully, but these errors were encountered:
Now Pony adds LIMIT 2 when it thinks that a query can return more than one row. But when Pony sees that the query uses an unique key and thus no duplicates are possible, then LIMIT 2 will not be added, because it looks redundant and shouldn't influence anything.
One of the purposes of
entity.get()
is to detectMultipleObjectsFoundError
. If you addlimit 2
to SQL queries, SQL server can use less resources while executing the query. For example, SQL server can stop populating internal cache if only two records needed. Yes I know that we may use cursors, but still sure thatlimit 2
will not hurt in performance in any way.The text was updated successfully, but these errors were encountered: