. Not very clear, probably guess, when you say index refers to the general index, key refers to the primary key index? Because the index can be divided into field index and combined index from the number of fields (an index formed by multiple fields, multi-level relationship), and from the index type into general index, unique index, primary key index and full-text index. Based on the fact that you don't know much about the index (personal judgment), I will give you the following answer:
Index efficiency is determined by the repeatability of the index, for example, the field aid is a unique value, even if you do not set a unique index, it is actually equivalent to a unique index, and the index type of primary key index is the most efficient, but it can only set one, so it is generally used as a lookup identity. If you want to index a relational table, it would be nice to set two, one of which sets the table's identity field ID. Then another index creates an associated index AID,BID, it should be noted that according to your project requirements, the order of setting AID and BID needs to be adjusted, as for more, I do not think this table is needed, because the use of the index, it will only use one at a time. Please find out by yourself for more information.
index or key are just the names of the index. Depending on the demand, you can add a unique index to the required table. For intermediate tables, like the two indexes you add, it actually has an impact on query speed, but the data is unstable and can be solved by adding foreign keys in many-to-many tables. Finally, the indexed key pays attention to the length of the key to understand the concept of clustering.
I'm afraid you don't understand what an index is at all. The index has several indexes such as unique,primary key, key, fulltext, spatial, and then you can name it. And when you join multiple tables, it's not good to build an index individually, but it's your own use of this field, or how often you use it, to set up the index
.