ENH #6416: performance improvements on write - tradoff higher memory use for faster writes.
ENH #6416 cleanup for PR
Merge pull request #6420 from mangecoeur/sql-perf

ENH #6416: performance improvements on write