Skip to content

Commit

Permalink
Do not run compare_costs every time a join is recalculated.
Browse files Browse the repository at this point in the history
It makes known-good trees to fail to rebuild, triggering assertion
errors in places where the code wants to back out a move and needs to
rebuild a state that was previously built correctly.
  • Loading branch information
wulczer committed Oct 8, 2011
1 parent 2940d28 commit 353fc86
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/saio_recalc.c
Expand Up @@ -218,13 +218,22 @@ recalculate(QueryTree *tree, bool fake, void *extra_data)
* If this node alone has greater cost than the previous tree, we can try
* and eliminate it immediately.
*/
#ifdef NOT_USED
/*
* Bad idea! When recalculating known-good trees, we don't want to fail
* just because they're costly (or because we had bad luck with the
* PRNG). In any case, running compare_costs every time a tree is built
* makes the possibility of making an uphill move much, much lower which
* isn't necessarily good.
*/
if (!compare_costs(root, private->previous_cost,
SAIO_COST(rel), private->temperature))
{
return false;
}

return true;
#endig
}


Expand Down

0 comments on commit 353fc86

Please sign in to comment.