From 353fc86aad82c8362690a93a54f0d25c8947d49b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Urba=C5=84ski?= Date: Sat, 8 Oct 2011 18:42:00 +0200 Subject: [PATCH] Do not run compare_costs every time a join is recalculated. 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. --- src/saio_recalc.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/saio_recalc.c b/src/saio_recalc.c index e62e551..b556a8b 100644 --- a/src/saio_recalc.c +++ b/src/saio_recalc.c @@ -218,6 +218,14 @@ 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)) { @@ -225,6 +233,7 @@ recalculate(QueryTree *tree, bool fake, void *extra_data) } return true; +#endig }