OK so we have a query that does OK in 8.4, goes to absolute crap in 9.2 and then works great in 9.3. Thing is we've spent several months regression testing 9.2 and no time testing 9.3, so we can't just "go to 9.3" in an afternoon. But we might have to. 9.2 seems hopelessly broken here.
The query looks something like this:
SELECT COUNT(*) FROM u, ug WHERE u.ugid = ug.id AND NOT u.d AND ug.somefield IN (SELECT somefunction(12345));