Improved ID ordering in table creation for composite keys