Comment 9 for bug 646898

Revision history for this message
Stewart Smith (stewart) wrote :

So my little experiment with packing the rows was pretty easy to turn into something that was actually fully functional and would pass tests.

commit log kinda explaining it:

  Replace FunctionCursor row_cache of full rows with one that is the
  packed row (using similar routines as ARHCIVE does before
  compression). This means we use minimal memory for each row. The ref
  for ::position() is now a offset into the row_cache buffer instead of
  an incrementing index into an array.

  This change GREATLY reduces the memory required for various queries on
  table function tables.

  e.g. (measured using valgrind --tool=massif) running the
  information_schema_dictionary test suite
  BEFORE: peaked at 77.5MB heap usage
  AFTER: peaked at 33.7MB heap usage

  for schema_dictionary suite:
  BEFORE: peaked at 782.6MB heap usage
  AFTER: peaked at 31.05MB heap usage

  (i.e. memory requirements can be reduced by moer than an order of
  magnitude)

  A future patch may want to also overflow to disk if needed.