public static function usesAllIndexes($sql): bool
    {
        $qh = self::getInstance()->sql_query('EXPLAIN ' . $sql);

        if (!$qh->rowCount()) {
            return false;
        }

        while ($q = $qh->fetch(PDO::FETCH_ASSOC)) {
            if (!$q['key']) {
                return false;
            }
        }

        return true;
    }
public static function usesAllIndexes($sql): bool
    {
        $qh = self::getInstance()->sql_query('EXPLAIN ' . $sql);

        if (!$qh->rowCount()) {
            return false;
        }

        while ($q = $qh->fetch(PDO::FETCH_ASSOC)) {
            if (!$q['key']) {
                return false;
            }
        }

        return true;
    }
public static function usesAllIndexes ( $ sql ) : bool { $ qh = self :: getInstance ( ) -> sql_query ( 'EXPLAIN ' . $ sql ) ; if ( ! $ qh -> rowCount ( ) ) { return false ; } while ( $ q = $ qh -> fetch ( PDO :: FETCH_ASSOC ) ) { if ( ! $ q [ 'key' ] ) { return false ; } } return true ; }
Check if query uses all possible db table indexes

@param string $sql
@return bool
Check if query uses all possible db table indexes