Use table name as a prefix for index names

This solves #2778.
But it may cause long index names. I don't know what is the limit for the length of an index name.