Skip to main content
2 of 3
edited title
Tom V
  • 15.7k
  • 7
  • 64
  • 87

How does InnoDB represent composite integer keys?

I let's say I have the following table:

Create Table Orders(server : tiny int, ticket : integer, primary key (server, ticket));

How is the composite primary key representation when stored on disk?

  1. server * 2^32 + ticket (a numeric composition of the two keys)
  2. server & " " & ticket (a string concatenation of the two attributes)
  3. Somthing entirely different