use array for speed

use array for speed

diff --git a/bench/topic_mysql_perf.rb b/bench/topic_mysql_perf.rb
index 7dad663..dbbcb0f 100644
--- a/bench/topic_mysql_perf.rb
+++ b/bench/topic_mysql_perf.rb
@@ -292,19 +292,18 @@ Benchmark.ips do |r|
   r.compare!
 end
 
-# Comparison:
-# mysql select title id:      486.5 i/s
-# mini_sql query_single title id:      450.3 i/s - same-ish: difference falls within error
-# sequel title id pluck:      367.9 i/s - 1.32x  slower
-# sequel title id select:      352.5 i/s - 1.38x  slower
-# mini_sql select title id:      346.2 i/s - 1.41x  slower
-# ar select title id pluck:      320.5 i/s - 1.52x  slower
-#   ar select title id:      102.8 i/s - 4.73x  slower
-
-
-# Comparison:
-#  wide topic mini sql:     7837.2 i/s
-#     wide topic mysql:     7085.7 i/s - same-ish: difference falls within error
-#    wide topic sequel:     5168.7 i/s - 1.52x  slower
-#        wide topic ar:     2631.7 i/s - 2.98x  slower
+Comparison:
+mysql select title id:      471.8 i/s
+mini_sql query_single title id:      447.8 i/s - same-ish: difference falls within error
+mini_sql select title id:      417.3 i/s - same-ish: difference falls within error
+sequel title id pluck:      367.8 i/s - 1.28x  slower
+sequel title id select:      335.9 i/s - 1.40x  slower
+ar select title id pluck:      311.1 i/s - 1.52x  slower
+  ar select title id:      101.9 i/s - 4.63x  slower
+
+Comparison:
+ wide topic mini sql:     6994.7 i/s
+    wide topic mysql:     6467.2 i/s - same-ish: difference falls within error
+   wide topic sequel:     4826.8 i/s - 1.45x  slower
+       wide topic ar:     2454.5 i/s - 2.85x  slower
 
diff --git a/lib/mini_sql/mysql/connection.rb b/lib/mini_sql/mysql/connection.rb
index 300d8a9..edc29d1 100644
--- a/lib/mini_sql/mysql/connection.rb
+++ b/lib/mini_sql/mysql/connection.rb
@@ -19,17 +19,17 @@ module MiniSql
       end
 
       def query_hash(sql, *params)
-        result = run(sql, params)
+        result = run(sql, :hash, params)
         result.to_a
       end
 
       def exec(sql, *params)
-        run(sql, params)
+        run(sql, :array, params)
         raw_connection.affected_rows
       end
 
       def query(sql, *params)
-        result = run(sql, params)
+        result = run(sql, :array, params)
         @deserializer_cache.materialize(result)
       end
 
@@ -43,11 +43,11 @@ module MiniSql
 
       private
 
-      def run(sql, params)
+      def run(sql, as, params)
         if params && params.length > 0
           sql = param_encoder.encode(sql, *params)
         end
-        raw_connection.query(sql, as: :hash)
+        raw_connection.query(sql, as: as)
       end
     end
   end
diff --git a/lib/mini_sql/mysql/deserializer_cache.rb b/lib/mini_sql/mysql/deserializer_cache.rb
index 3e95c95..eb481b1 100644
--- a/lib/mini_sql/mysql/deserializer_cache.rb
+++ b/lib/mini_sql/mysql/deserializer_cache.rb
@@ -10,7 +10,6 @@ module MiniSql
       end
 
       def materialize(result)
-
         key = result.fields
 
         # trivial fast LRU implementation
@@ -49,7 +48,7 @@ module MiniSql
           instance_eval <<~RUBY
             def materialize(data)
               r = self.new
-              #{fields.map{|f| "r.#{f} = data[#{f.inspect}]"}.join("; ")}
+              #{col=-1; fields.map{|f| "r.#{f} = data[#{col+=1}]"}.join("; ")}
               r
             end
           RUBY

GitHub sha: 3510c59c