8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-24 04:03:03 +01:00
This commit is contained in:
dimitr 2010-01-18 11:39:34 +00:00
parent 974afe28a1
commit df53be29bf
3 changed files with 3 additions and 9 deletions

View File

@ -3228,7 +3228,6 @@ void OptimizerInnerJoin::findBestOrder(int position, InnerJoinStreamInfo* stream
new_cardinality = position_cardinality * cardinality; new_cardinality = position_cardinality * cardinality;
} }
optimizer->opt_combinations++;
// If the partial order is either longer than any previous partial order, // If the partial order is either longer than any previous partial order,
// or the same length and cheap, save order as "best". // or the same length and cheap, save order as "best".
if (position > optimizer->opt_best_count || if (position > optimizer->opt_best_count ||

View File

@ -413,9 +413,9 @@ RecordSource* OPT_compile(thread_db* tdbb,
// memory will then be in csb->csb_rpt[stream].csb_idx_allocation, which // memory will then be in csb->csb_rpt[stream].csb_idx_allocation, which
// gets cleaned up before this function exits. // gets cleaned up before this function exits.
OptimizerBlk* opt = FB_NEW(*tdbb->getDefaultPool()) OptimizerBlk(tdbb->getDefaultPool()); AutoPtr<OptimizerBlk> opt(FB_NEW(*tdbb->getDefaultPool()) OptimizerBlk(tdbb->getDefaultPool()));
opt->opt_streams.grow(csb->csb_n_stream); opt->opt_streams.grow(csb->csb_n_stream);
RecordSource* rsb = 0; RecordSource* rsb = NULL;
try { try {
@ -988,9 +988,6 @@ RecordSource* OPT_compile(thread_db* tdbb,
csb->csb_rpt[stream].csb_indices = 0; csb->csb_rpt[stream].csb_indices = 0;
} }
// free up memory for optimizer structures
delete opt;
#ifdef OPT_DEBUG #ifdef OPT_DEBUG
if (opt_debug_file) if (opt_debug_file)
{ {
@ -1007,10 +1004,9 @@ RecordSource* OPT_compile(thread_db* tdbb,
{ {
const USHORT stream = streams[i]; const USHORT stream = streams[i];
delete csb->csb_rpt[stream].csb_idx; delete csb->csb_rpt[stream].csb_idx;
csb->csb_rpt[stream].csb_idx = 0; csb->csb_rpt[stream].csb_idx = NULL;
csb->csb_rpt[stream].csb_indices = 0; // Probably needed to be safe csb->csb_rpt[stream].csb_indices = 0; // Probably needed to be safe
} }
delete opt;
throw; throw;
} }

View File

@ -90,7 +90,6 @@ class OptimizerBlk : public pool_alloc<type_opt>
{ {
public: public:
CompilerScratch* opt_csb; // compiler scratch block CompilerScratch* opt_csb; // compiler scratch block
SLONG opt_combinations; // number of partial orders considered
double opt_best_cost; // cost of best join order double opt_best_cost; // cost of best join order
USHORT opt_best_count; // longest length of indexable streams USHORT opt_best_count; // longest length of indexable streams
USHORT opt_base_conjuncts; // number of conjuncts in our rse, next conjuncts are distributed parent USHORT opt_base_conjuncts; // number of conjuncts in our rse, next conjuncts are distributed parent