<commit_before>package edu.ucsc.dbtune.optimizer;

import java.sql.SQLException;
import java.util.Set;

import edu.ucsc.dbtune.IBGSpaceComputation;
import edu.ucsc.dbtune.inum.EagerSpaceComputation;
import edu.ucsc.dbtune.inum.ExhaustiveMatchingStrategy;
import edu.ucsc.dbtune.inum.InumSpaceComputation;

import edu.ucsc.dbtune.optimizer.plan.InumPlan;
import edu.ucsc.dbtune.workload.SQLStatement;

/**
 * Implements an INUM-based optimizer.
 * <p>
 * The passed delegate optimizer should be able to produce plans, i.e. the {@link 
 * edu.ucsc.dbtune.optimizer.ExplainedSQLStatement} objects that get generated by it should return a 
 * non-null instance when calling {@link edu.ucsc.dbtune.optimizer.ExplainedSQLStatement#getPlan}.
 *
 * @author <NAME>
 */
public class InumOptimizer extends AbstractOptimizerWithDelegate
{
    /**
     * inum space computation. This could be passed as argument of the constructor if other kind of 
     * computation is needed
     */
    private InumSpaceComputation inumSpaceComputation;

    /**
     * Constructs an {@code InumOptimizer}. Relies on the given {@code optimizer} to execute actual 
     * optimization calls.
     *
     * @param optimizer
     *      a DBMS-specific implementation of an {@link Optimizer} type.
     */
    public InumOptimizer(Optimizer optimizer)
    {
        this.delegate = optimizer;
//        this.inumSpaceComputation = new EagerSpaceComputation();
        this.inumSpaceComputation = new IBGSpaceComputation();
    }

    /**
     * Build an {@link Inum} object corresponding to a specific {@link SQLStatement}.
     *
     * @param sql
     *      the statement
     * @return
     *      the index usage model for the given statement
     * @throws SQLException
     *      if there's an while building the Inum object
     */
    Set<InumPlan> computeInumSpace(SQLStatement sql) throws SQLException
    {<commit_msg>Disabling IBGSpaceComputation temporarily<commit_after>package edu.ucsc.dbtune.optimizer;

import java.sql.SQLException;
import java.util.Set;

import edu.ucsc.dbtune.inum.EagerSpaceComputation;
import edu.ucsc.dbtune.inum.IBGSpaceComputation;
import edu.ucsc.dbtune.inum.ExhaustiveMatchingStrategy;
import edu.ucsc.dbtune.inum.InumSpaceComputation;

import edu.ucsc.dbtune.optimizer.plan.InumPlan;
import edu.ucsc.dbtune.workload.SQLStatement;

/**
 * Implements an INUM-based optimizer.
 * <p>
 * The passed delegate optimizer should be able to produce plans, i.e. the {@link 
 * edu.ucsc.dbtune.optimizer.ExplainedSQLStatement} objects that get generated by it should return a 
 * non-null instance when calling {@link edu.ucsc.dbtune.optimizer.ExplainedSQLStatement#getPlan}.
 *
 * @author <NAME>
 */
public class InumOptimizer extends AbstractOptimizerWithDelegate
{
    /**
     * inum space computation. This could be passed as argument of the constructor if other kind of 
     * computation is needed
     */
    private InumSpaceComputation inumSpaceComputation;

    /**
     * Constructs an {@code InumOptimizer}. Relies on the given {@code optimizer} to execute actual 
     * optimization calls.
     *
     * @param optimizer
     *      a DBMS-specific implementation of an {@link Optimizer} type.
     */
    public InumOptimizer(Optimizer optimizer)
    {
        this.delegate = optimizer;
        this.inumSpaceComputation = new EagerSpaceComputation();
        //this.inumSpaceComputation = new IBGSpaceComputation();
    }

    /**
     * Build an {@link Inum} object corresponding to a specific {@link SQLStatement}.
     *
     * @param sql
     *      the statement
     * @return
     *      the index usage model for the given statement
     * @throws SQLException
     *      if there's an while building the Inum object
     */
    Set<InumPlan> computeInumSpace(SQLStatement sql) throws SQLException
    {
{'fraction_non_alphanumeric': 0.08574407088871515, 'fraction_numerical': 0.0, 'mean_word_length': 3.302690582959641, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3834404', 'n_tokens_mistral': 1177, 'n_tokens_neox': 1158, 'n_words': 314}