WL#9387: InnoDB: Group purging of rows by table ID
Affects: Server-8.0
—
Status: Complete
Since the introduction of multi-threaded purge the purge threads work on random undo log records. If different purge threads all purge from the same table this leads to higher contention on the dict_index_t::lock (RW-LOCK). To reduce dict_index_t::lock contention, we should group the undo rows by table ID and then parcel the work to the purge threads based on the table id. This is a feature request from Facebook Inc.
NF1 - Improvement in performance expected in 5.6 when purging rows from several tables simultaneously. In 5.7+ the dict_index_t::lock improvements mitigate the problem.
This is a very low level small internal change. It should improve performance when lots of purge threads attempt to purge the rows from the same table. 1. Read the undo log records and group by table ID 2. Assign the undo log rows grouped during stage #1 to the purge threads
map{table_id, list {row}} foreach row in undo_log parse table_id from row map[table_id].list.append(row) done work[N_PURGE_THREADS] # The aim is for each thread to work on a dedicated table foreach list_of_rows in map foreach thread in threads thread.work += list_of_rows done done Rest as usual.
Copyright (c) 2000, 2024, Oracle Corporation and/or its affiliates. All rights reserved.