Skip to content
  • Olav Sandstaa's avatar
    91b65d99
    WL#7168 API for estimates for how much of table and index data that is in memory buffer · 91b65d99
    Olav Sandstaa authored
    To improve the current cost estimation functions for reading data from
    a table or index, information about whether table or index data is in
    memory or need to be read from disk is needed. The worklog extends the
    handler with:
    
    a) Data structures where storage engines can provide estimates for
       how much of data from tables and indexes that are stored in a main
       memory buffer.
    b) An API that the optimizer cost model can use to access this information.
    c) A default implementation/heuristic that can be used if the storage
       engine has not provided this information.
    
    In addition, the ha_heap::info() function for the Memory engine is
    extended to provide these estimates.
    
    Per file comments:
    
    sql/handler.cc:
      Default implementations for the functions that provide estimates
      about how much of tables and indexes are stored in a memory buffer.
    sql/handler.h:
      Extend the handler class with:
      a) data structure for the storage engines to provide estimates for
         how much of a table that is currently stored in a memory buffer.
         This is done by extending the ha_statistics class with a new
         variable.
      b) an API that the cost calculation functions can use for getting
         information about how much of tables and indexes are in a
         memory buffer.
    sql/key.h:
      Extend st_key with a new variable and functions that can be used by
      storage engines for providing an estimate of how much of the index data
      that is currently stored in a main memory buffer.
    sql/table.cc:
      Initialize the st_key::in_memory_estimate to a default value.
    sql/sql_tmp_table.cc:
      Initialize the st_key::in_memory_estimate to a default value.
    storage/heap/ha_heap.cc:
      Extend ha_heap::info() to provide estimates for how much of
      tables and indexes that are currently stored in a main memory buffer.
    unittest/gunit/key-t.cc:
      Added unit test for interface for setting and getting in-memory estimates.
    unittest/gunit/handler-t.cc:
      Added unit test for handler::table_in_memory_estimate() and
      handler::index_in_memory_estimate().
    91b65d99
    WL#7168 API for estimates for how much of table and index data that is in memory buffer
    Olav Sandstaa authored
    To improve the current cost estimation functions for reading data from
    a table or index, information about whether table or index data is in
    memory or need to be read from disk is needed. The worklog extends the
    handler with:
    
    a) Data structures where storage engines can provide estimates for
       how much of data from tables and indexes that are stored in a main
       memory buffer.
    b) An API that the optimizer cost model can use to access this information.
    c) A default implementation/heuristic that can be used if the storage
       engine has not provided this information.
    
    In addition, the ha_heap::info() function for the Memory engine is
    extended to provide these estimates.
    
    Per file comments:
    
    sql/handler.cc:
      Default implementations for the functions that provide estimates
      about how much of tables and indexes are stored in a memory buffer.
    sql/handler.h:
      Extend the handler class with:
      a) data structure for the storage engines to provide estimates for
         how much of a table that is currently stored in a memory buffer.
         This is done by extending the ha_statistics class with a new
         variable.
      b) an API that the cost calculation functions can use for getting
         information about how much of tables and indexes are in a
         memory buffer.
    sql/key.h:
      Extend st_key with a new variable and functions that can be used by
      storage engines for providing an estimate of how much of the index data
      that is currently stored in a main memory buffer.
    sql/table.cc:
      Initialize the st_key::in_memory_estimate to a default value.
    sql/sql_tmp_table.cc:
      Initialize the st_key::in_memory_estimate to a default value.
    storage/heap/ha_heap.cc:
      Extend ha_heap::info() to provide estimates for how much of
      tables and indexes that are currently stored in a main memory buffer.
    unittest/gunit/key-t.cc:
      Added unit test for interface for setting and getting in-memory estimates.
    unittest/gunit/handler-t.cc:
      Added unit test for handler::table_in_memory_estimate() and
      handler::index_in_memory_estimate().
Loading