~maria-captains/maria/5.2

Viewing all changes in revision 2502.1197.1.

  • Committer: Mattias Jonsson
  • Date: 2012-08-15 12:31:26 UTC
  • mto: (2502.1195.30 topush-5.1)
  • mto: This revision was merged to the branch mainline in revision 3182.
  • Revision ID: mattias.jonsson@oracle.com-20120815123126-qz4g4bjzxpchvrre
Bug#13025132 - PARTITIONS USE TOO MUCH MEMORY

The buffer for the current read row from each partition
(m_ordered_rec_buffer) used for sorted reads was
allocated on open and freed when the ha_partition handler
was closed or destroyed.

For tables with many partitions and big records this could
take up too much valuable memory.

Solution is to only allocate the memory when it is needed
and free it when nolonger needed. I.e. allocate it in
index_init and free it in index_end (and to handle failures
also free it on reset, close etc.)

Also only allocating needed memory, according to
partitioning pruning.

Manually tested that it does not use as much memory and
releases it after queries.

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: