View Single Post
Old 03-08-2011, 12:15 PM   #22
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,471
Karma: 8025600
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by kovidgoyal View Post
Since the set will typically be empty, seems like it shouldn't be much overhead. We can optimize the case of an empty set so that it is only a single if statement per refresh call.
So, this is a boolean column, tested for presence in a set. That means that the user cannot provide different values, permitting sorting, subsearching, etc. OK with everyone? If not, then I need provide a dict interface, where the caller gives me {id:val,...}

As for the empty set, I am not convinced that an 'if foo: xxx' is much faster than 'if id in some_empty_set'.
chaley is offline   Reply With Quote