Fixed a problem where `sum`, `size`, `average`, `minimum` and `maximum` used
with a grouping was not returning a Hash.
Move PG OID types to their own files

As we promote these classes to first class concepts, these classes are
starting to gain enough behavior to warrant being moved into their own
files. Many of them will become quite large as we move additional
behavior to the type objects.
Rename `oid_type` to `cast_type` to make PG columns consistent
Merge pull request #15227 from sgrif/sg-rename-oid-type

Rename `oid_type` to `cast_type` to make PG columns consistent with abstract columns
fixes in active record query for reorder
Merge pull request #15229 from peeyushsingla/master

fixes in active record query for reorder in rails guides
Fix typo guides/source/active_support_instrumentation.md
Merge pull request #15231 from khusnetdinov/fix_typo_guides_active_support_instrumentation

Fix typo guides/source/active_support_instrumentation.md [ci-skip]
push the formatter up to the Route object
do not mutate parameters, let the caller do mutations
make variable name more clear
reduce object allocations

Example:

x = [1,2,3,4]
y = [3,2,1]

def test x, y
  hash = {}
  x.zip(y) { |k,v| hash[k] = v }
  hash
end

def test2 x, y
  Hash[x.zip(y)]
end

def test3 x, y
  x.zip(y).each_with_object({}) { |(k,v),hash| hash[k] = v }
end

def stat num
  start = GC.stat(:total_allocated_object)
  num.times { yield }
  total_obj_count = GC.stat(:total_allocated_object) - start
  puts "#{total_obj_count / num} allocations per call"
end

stat(100) { test(x,y) }
stat(100) { test2(x,y) }
stat(100) { test3(x,y) }

__END__
2 allocations per call
7 allocations per call
8 allocations per call
reuse path formatter from the non-optimized path.

The optimized and non-optimized path share more code now without
significant performance degretation
Move extract_scale to decimal type

The only type that has a scale is decimal. There's a special case where
decimal columns with 0 scale are type cast to integers if the scale is
not specified. Appears to only affect schema dumping.
we can just use Ruby here
remove dead code. @klass isn't used anymore
use the existing constant rather than the hardcoded string

so tht I don't go totally insane with THsi crazy hash driven
development. why is Everything a hash? Why do people think hashes in
hashes with random keys is a Good API? You can't find things or
deprecate them or control access whatsoever, you just have to hope that
everyone is like "oh, you want to change that? that's cool! we all know
it's hashes so go for it!"

The End.
middle variable is never used, so rm
fewer object allocations and method calls during route match
drop hash allocations during match