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
2011-04-18 16:30:48 -07:00
2011-04-18 16:30:48 -07:00
2011-06-20 12:13:45 -07:00
Description
No description provided
55 MiB
Languages
Python 54.4%
JavaScript 26.7%
HTML 11.3%
Less 4.5%
Shell 1%
Other 2%