So i basically have a link table connecting the user to an event, the structure is basically this:
This table is massive with each user having about 24 entries and there are alot of users. I was just wondering if there is a way that i could optimise the select query or if MySQL does the optimisation for me.
Right so 6000 users with 24 rows, you are talking less than 150000 rows. I'm telling you above that in the millions of rows your queries would still be lightning fast.
You don't need to alphabetize the users ID field, that is what an index will do. You add the rows in whatever order and the index speeds up the search. Without an index every row would have to be compared in your search. With an index it would quickly jump to "C" then "CB" then "CBA" etc. if you get my example.