src/Soluble/Schema/Source/Mysql/AbstractMysqlDriver.php
protected function disableInnoDbStats()
    {
        $sql = "show global variables like 'innodb_stats_on_metadata'";
        try {
            $results = $this->adapter->query($sql);
            if (count($results) > 0) {
                $row = $results->offsetGet(0);

                $value = strtoupper($row['Value']);
                // if 'on' no need to do anything
                if ($value != 'OFF') {
                    $this->mysql_innodbstats_value = $value;
                    // disabling innodb_stats
                    $this->adapter->query("set global innodb_stats_on_metadata='OFF'");
                }
            }
        } catch (\Exception $e) {
            // do nothing, silently fallback
        }
    }
protected function disableInnoDbStats()
    {
        $sql = "show global variables like 'innodb_stats_on_metadata'";
        try {
            $results = $this->adapter->query($sql);
            if (count($results) > 0) {
                $row = $results->offsetGet(0);

                $value = strtoupper($row['Value']);
                // if 'on' no need to do anything
                if ($value != 'OFF') {
                    $this->mysql_innodbstats_value = $value;
                    // disabling innodb_stats
                    $this->adapter->query("set global innodb_stats_on_metadata='OFF'");
                }
            }
        } catch (\Exception $e) {
            // do nothing, silently fallback
        }
    }
protected function disableInnoDbStats ( ) { $ sql = "show global variables like 'innodb_stats_on_metadata'" ; try { $ results = $ this -> adapter -> query ( $ sql ) ; if ( count ( $ results ) > 0 ) { $ row = $ results -> offsetGet ( 0 ) ; $ value = strtoupper ( $ row [ 'Value' ] ) ; // if 'on' no need to do anything if ( $ value != 'OFF' ) { $ this -> mysql_innodbstats_value = $ value ; // disabling innodb_stats $ this -> adapter -> query ( "set global innodb_stats_on_metadata='OFF'" ) ; } } } catch ( \ Exception $ e ) { // do nothing, silently fallback } }
Disable innodbstats will increase speed of metadata lookups.
Disable innodbstats will increase speed of metadata lookups .