SourceForge has been redesigned. Learn more.
Close

#19 Add warning for negative slices on large result sets

closed-rejected
None
5
2005-07-20
2005-07-12
No

This patch emits a warning when using negative slices
or indices on large result sets. Because doing
Foo.select(...)[-1] on a 1 million row table has to
fetch 1 million rows rather than just 1, it's a hidden
performance trap. This patch emits a warning when a
SelectResults is sliced with a negative index, and the
size of the result set being slices is more than 100
elements.

SelectResults usually does a good job of efficiently
getting the results you ask it for, but in this case it
doesn't, which can be surprising. This warning helps
make the problem less surprising.

Discussion

  • Oleg Broytman

    Oleg Broytman - 2005-07-20
    • assigned_to: nobody --> phd
    • status: open --> closed-rejected
     

Log in to post a comment.