add check for indexing auto generated primary keys