Reputation: 2190
This online book describes how MySQL leverages B-Trees for indexing data. Time complexity depends on the number of entries per node.
How many entries does MySQL hold in one node?
Upvotes: 1
Views: 1605
Reputation: 142306
Rule of Thumb: 100.
This applies to InnoDB data BTrees and Index BTrees. However, it can be quite far off.
One extreme: only 1 data record in a node -- due to large row size and/or activity such as DELETEs
. Another case: A table with 1 record will still occupy a full 16KB block.
Other extreme: 500 index records in a node -- due to small size of key and lack of activity that would have deleted records.
Upvotes: 5