On Fri, Jan 28, 2011 at 12:29:18PM -0500, Yonik Seeley said: > That's odd - there should be nothing special about negative numbers. > Here are a couple of ideas: > - if you have a really big index and querying by a negative number > is much more rare, it could just be that part of the index wasn't > cached by the OS and so the query needs to hit the disk. This can > happen with any term and a really big index - nothing special for > negatives here. > - if -1 is a really common value, it can be slower. is fq=uid:\-2 or > other negative numbers really slow also?
This was my first thought but -1 is relatively common but we have other numbers just as common. Interestingly enough fq=uid:-1 fq=foo:bar fq=alpha:omega is much (4x) slower than q="uid:-1 AND foo:bar AND alpha:omega" but only when searching for that number. I'm going to wave my hands here and say something like "Maybe something to do with the field caches?"