1. Attached are optimisation patches already live in the [url removed, login to view] environment, so you can see the results and review the changes. Please apply these patches to [url removed, login to view]
2. For the event [url removed, login to view] ticket B has settings 'Start sales when sales end for ticket A'. Ticket A is sold out so ticket B should be selling. [url removed, login to view] However it is not selling. This has occurred with several events.
Similar issue for test ticket D. Ticket C is closed by date, so ticket D should be selling.
3. Change ticket status from Paid to Unpaid
On the page [url removed, login to view] It should be possible to untick the 'paid' checkbox next to a ticket and therefore change the status from paid to unpaid. This will be used for refunded orders.
4. Please implement all fixes if you agree these are ok.
4.1. The tag_taxonomy.tag_id column, which is supposed to be a foreign key pointing to [url removed, login to view], is declared as a varchar(255) instead of int(10). This means that mysql has to do unnecessary conversions to convert the varchar(255) to int(10) for each row in the query, each time the query is executed.
4.2. The "order by rand()" is a mysql disaster since it is expensive to perform (it forces the use of the temporary table and the filesort), and it means that the mysql query cache can't be used. So it's pretty much the worst thing you can do with mysql. There are many much better alternatives that we can easily program in the next phase.
4.3. The indexes declared on the tag_taxonomy table don't support this query so the database engine is forced to use the temporary table and the filesort even without the "order by rand()". This could be fixed by adding an appropriate compound primary key, eg
although whether this is necessary or not would depend on the solution to the "order by rand()" antipattern mentioned in point 4.2.