Files
reddit/r2
Neil Williams 165c3d12d6 Remove unnecessary conditions from some queries.
PG9 doesn't like the query from _load_link_comments
in comment_tree.py.

thing.py will automatically filter deleted and spam items
out of thing queries if no rules are specified for those
columns. To get around this, some queries, including the
_load_link_comments one, will specify a rule
like _spam == (True, False). This rule was left in the ruleset,
despite the fact that it's completely unnecessary from the
SQL's standpoint. Its presence then triggered the need of a
join against the thing table when only the data table was
truly necessary. The query planner in PG9 doesn't like this
particular query when it requires a join and will force a
full table scan as a result.

This patch notes the special case of _spam/_deleted ==
(True,False) and turns off the default filtering but removes
the rules from the query. This saves some WHERE clauses
and more importantly removes the need for a JOIN in queries
like this one.
2011-07-19 12:23:14 -07:00
..
2010-05-17 13:27:17 -07:00
2010-05-17 13:27:17 -07:00
2010-06-16 17:01:50 -07:00
2008-06-17 19:00:27 -07:00
2011-05-09 14:13:05 -07:00
2010-06-16 17:01:50 -07:00
2010-05-17 13:27:17 -07:00
2011-02-23 12:00:44 -08:00