Profile Order Counter
A profile widget shows how many orders belong to the user with user_id = 2. Add an index on orders.user_id so the counter works from the relevant rows instead of the whole table.
Speed this query up with an index
SELECT COUNT(*) FROM orders WHERE user_id = 2
Csak CREATE/ALTER/DROP — nincs szükség záró SELECT-re.
Jelentkezz be a beküldési előzmények megtekintéséhez
BejelentkezésJelentkezz be az MI-mentor használatához
Bejelentkezés