List:Internals« Previous MessageNext Message »
From:Michael Widenius Date:April 21 2008 6:25am
Subject:re: ordering of duplicate keys
View as plain text  
Hi!

>>>>> "Kathryn" == Kathryn Steinbrink <krs@stripped> writes:

Kathryn> Hello,
Kathryn> When processing key operations in the presence of duplicates, does MySQL
Kathryn> care about the order of the duplicates? For example, is there some kind of
Kathryn> FIFO or LIFO type ordering of the rows that should be honored when
Kathryn> returning duplicate keys?
Kathryn> Thanks!

For most engines, the keys will be ordered according to row order or
row id order. The row order is however quite random and may change
during load/restore.

The reason to have the keys in row order is that when you do a delete of
a row it's much faster to find the corresponding key among lots of
duplicates if keys are sorted according to row position / row id.

Regards,
Monty
Thread
ordering of duplicate keysKathryn Steinbrink15 Apr
  • RE: ordering of duplicate keysRick James19 Apr
  • re: ordering of duplicate keysMichael Widenius21 Apr