SQLite Questions
gabekanegae opened this issue ยท 5 comments
Hi. I'm trying to test and optimize a couple of things on my server, by playing with PreciousStones.db.
Only the pstone_cuboids and pstone_players tables have data in it. pstone_cuboids stores all protection data, as world, location, block, owner, allowed players, last used(?) and flags.
Question: What is pstone_players for? All I see is that it assigns an ID for each players (for some reason that full column is null for me), a last seen (for what?) and some flags which I have no idea what they mean and/or are for, as density:1, 8, 99 or 100 and disabled:true.
I have more than 30k entries in pstone_players, most of them are from players that don't play anymore. Can I drop it without losing any relevant data?
You can drop the players that have the other columns blank without issue. That table is to store settings for specific players. Will probably optimize that on the codebase so they are not saved in the first place unless they actually saved a setting.
DELETE FROM pstone_players WHERE flags = '{"density":8}'
The last seen column was there for the purging functionality. But that has been removed in the dev builds, to be added later in a different way.
Still I wound't advise you remove anything, couldn't tell you about sideeffects once purging has been added back. Its possible all players without records get their fields purged.
Anyways 30k records is nothing to a relational db when it comes to performance, talk to me when it gets into the hundreds of millions. At most you will be saving a few megs of space on the drive.
If you really want to optimize add an index on the player_name column.
Upgrade PS to the latest promoted build on my Jenkins. That issue was fixed on build 469.
My problem is that since the SQLite file got >15MB, my server started crashing when disabling PreciousStones (server shutdown, /stop). If I try to run it locally, I get http://pastebin.com/ehjQPAVh
Thought that tinkering with the .db might fix it.
Extra info: I tried to run it locally a couple months ago, and it disabled fine. For some reason it didn't/doesn't when ran at any host, and now it's throwing that pastebin when ran locally.