WL#2680: NDB: Support for batched UPDATE
Status: On-Hold — Priority: Low
With WL#2445 Batched operation of DELETE/UPDATE the new handler functions can be implemented in ndbcluster
The ndbcluster handler already handles batching of updates, but doesn't handle UPDATE WHERE LIMIT correctly. New calls are defined in WL#2445 Batched operation of DELETE/UPDATE to support limit correctly when batching updates.
The following new calls to ha_ndbcluster will be implemented: bool ha_ndbcluster::start_bulk_update() Calculate how many rows should be updated per roundtrip to NDB. This is done in order to minimize the number of roundtrips as much as possible. However, real-time performance is degraded of too many bytes are updated at once, hence a maximum of 8KB is defined for each batch. Set the handler instance in bulk update mode by setting m_bulk_update_rows to the number of bytes per batch. Call will always succeed (returns 0). int ha_ndbcluster::bulk_update_row(const byte *old_data, byte *new_data, uint *dup_key_found) Call ha_ndbcluster::update_row (which will batch updates if handler is in bulk update mode. The counter m_rows_updated counts how many pending update operations are waiting execution. If m_rows_updated becomes exactly one full batch then the pending operations are flushed. Check if call returned HA_ERR_FOUND_DUPP_KEY then increment dup_key_found with the number duplicates found in batch. int ha_ndbcluster::exec_bulk_update(uint *dup_key_found) Execute all outstanding updates, but don't commit transaction. Check if execute call returned HA_ERR_FOUND_DUPP_KEY then increment dup_key_found with the number duplicates found in batch. int ha_ndbcluster::end_bulk_update() Set m_rows_updated = 0.
Copyright (c) 2000, 2017, Oracle Corporation and/or its affiliates. All rights reserved.