Ledger icon indicating copy to clipboard operation
Ledger copied to clipboard

Checking logs takes super long.

Open timtijmen2 opened this issue 2 years ago • 4 comments

Expected behavior

Logs showing up when i look for them.

Observed/actual behavior

When i use /ledger search on anything no matter how small it will often take 5-10 minutes to actually show up. This also happens with the inspect function.

Steps/models to reproduce

/ledger search range:10 action:item-remove ledger inspect and then clicking on a block

What operating system are you running

Windows

Minecraft version

1.19.4

Ledger version

1.2.7

Logs

none aplicable

Agreements

  • [X] I am running the latest version of the mod.
  • [X] My version of Minecraft is supported.
  • [X] I have searched for and ensured there isn't already an open issue regarding this.

Other

No response

timtijmen2 avatar Apr 05 '23 16:04 timtijmen2

The error still persists. Discovered full scan queries on mysql. They are not executed at all, because... 1 million records are being scanned

HyperPaint avatar Jan 03 '24 15:01 HyperPaint

Example

SELECT COUNT(*) FROM actions INNER JOIN ActionIdentifiers ON ActionIdentifiers.id = actions.action_id INNER JOIN worlds ON worlds.id = actions.world_id LEFT JOIN players ON players.id = actions.player_id INNER JOIN ObjectIdentifiers oldObjects ON actions.old_object_id = oldObjects.id INNER JOIN ObjectIdentifiers ON actions.object_id = ObjectIdentifiers.id INNER JOIN sources ON sources.id = actions.source WHERE (actions.x BETWEEN 1213 AND 1231) AND (actions.y BETWEEN 124 AND 142) AND (actions.z BETWEEN 197 AND 215) AND (worlds.identifier = 'minecraft:overworld')

There is no date in query, as the result it costs 66000 in mysql

HyperPaint avatar Jan 03 '24 15:01 HyperPaint

With date this query costs 66000 too

HyperPaint avatar Jan 04 '24 05:01 HyperPaint

I have same bug. Everything is exactly as HyperPaint wrote

Lord-Voidy avatar Jan 04 '24 12:01 Lord-Voidy

Workarounded with https://github.com/HyperPaint/Ledger/commit/7b64753e74bfd888c8caef8e019a05eb0a32e0b3

HyperPaint avatar Jan 09 '24 11:01 HyperPaint