eveseat / seat

🌀✳️ SeAT: A Simple, EVE Online API Tool and Corporation Manager

Home Page:https://eveseat.github.io/docs/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Potential missing index for larger amounts of data in character_wallet_journals

kwazulueve opened this issue · comments

  • Problem: High database load

In our table character_wallet_journals we have over 10 million rows, quite a few characters having 100 k+ rows, and some individuals having over 500 k entries. There is a query (example shown below) that causes significant load on the mysql database, possibly to update the value of the corresponding character entry in character_wallet_balances (but I do not know that certain)

MySQLWorkbench_2022-08-25_00-32-27.

I've manually added an extra index (KEY idx_character_wallet_journals_character_id_date (character_id,date)) that completely removes these heavy queries and brings down the server load.

hi @kwazulueve

I've been able to confirm this. I've not been able to find what is generating this exact query though.
Wallet table are paginating result using limit 10 offset X where X is the current page * 10.

Without your index

image

With your index

image

Update will be shipped on next update.