Bug #59516 ha_ndbcluster::read_time() is not implemented
Submitted: 14 Jan 2011 21:10 Modified: 17 Jan 2011 9:55
Reporter: Ole John Aske Email Updates:
Status: Verified Impact on me:
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S3 (Non-critical)
Version: OS:Any
Assigned to: Ole John Aske CPU Architecture:Any

[14 Jan 2011 21:10] Ole John Aske
The virtual handler::read_time() is used (together with ::scan_time()) by the cost optimizer to select the best access pattern for a table.

::read_time() has not been implemented by ha_ndbcluster - Therefore a comparison with cost estimates returned by ha_ndbcluster::scan_time() does not make sense.

When implementing ::read_time(), keep in  mind:

- The 'cost' estimate returned from ::read_time() should be 
  comparable with thoose returned from ::scan_time().
- The optimizer also calculates its own 'cost' for primary/unique 
  key lookup with cost= 1 for each lookup.
- The metric for the cost estimates seems to be #disk seeks assumed 
  to be required to read / scan the rows. This does not make sense
  for Cluster, but a fairly good metric for Cluster could be #RPC
  calls required for the operation.

  ::scan_time() currently returns a cost which is (#rows x 1000).
  This is far out related to the discussion above and should be adjusted
  together with implementing ::read_time()

How to repeat:
N/A - read the code!

Suggested fix:
Implement ::read_time() and adjust the cost returned from ::scan_time() wrt. the cost estimated by ::read_time()