twohoursonelife / OneLifeWeb

Web services used by the game server and client of OneLife, now seperate from the monolith repository.
https://twohoursonelife.com
Other
3 stars 2 forks source link

Lineage long queries #18

Open connorhsm opened 4 months ago

connorhsm commented 4 months ago

Spam reports of long queries.

'This query took 1,721 miliseconds:  SELECT lives.id, display_id, player_id, name, age, generation, death_time, deepest_descendant_generation, servers.server FROM lineageServer_lives as lives   INNER JOIN lineageServer_users as users ON lives.user_id = users.id INNER JOIN lineageServer_servers as servers ON lives.server_id = servers.id   WHERE 1  AND age >= 50 ORDER BY death_time DESC LIMIT 5;', '2024-07-18 14:11:54'

'This query took 6,773 miliseconds:  SELECT lives.id, display_id, player_id, name, age, generation, death_time, deepest_descendant_generation, servers.server FROM lineageServer_lives as lives   INNER JOIN lineageServer_users as users ON lives.user_id = users.id INNER JOIN lineageServer_servers as servers ON lives.server_id = servers.id   WHERE 1  AND age >= 20 AND age < 50 ORDER BY death_time DESC LIMIT 5;', '2024-07-18 12:44:48'

'This query took 6,146 miliseconds:  SELECT lives.id, display_id, player_id, name, age, generation, death_time, deepest_descendant_generation, servers.server FROM lineageServer_lives as lives   INNER JOIN lineageServer_users as users ON lives.user_id = users.id INNER JOIN lineageServer_servers as servers ON lives.server_id = servers.id   WHERE 1  AND death_time >= DATE_SUB( NOW(), INTERVAL 1 DAY ) ORDER BY lineage_depth DESC, death_time DESC LIMIT 5;', '2024-07-18 08:37:23'
connorhsm commented 4 months ago

Does not appear we've missed any of OHOLs indexes, unfortunately wont be a simple fix then.