check which primary key is auto increment

When the auto increment is not set on the first key of the primary there is a bug. 

Having a structure where the first key of a primary key is fixe (like a user_id for example) and the second auto-increment is a optimization for search query base on the first primary key entry.