can anyone give me tip how to delete all items, skill, prof, itemadd etc.. if character is deleted?
You can have triggers in MySQL which auto-delete related records using foreign keys. Or, you can just issue the deletes programmatically after calling character delete for each table you need to clean up. I'm assuming you're using MySQL because this question would be super weird otherwise.Quote:
can anyone give me tip how to delete all items, skill, prof, itemadd etc.. if character is deleted?
What on Earth are you talking about? You don't need a select, then an update, then a delete for every single item. That's so much more expensive than just deleting in bulk as a single operation per table. What's your reasoning for that? I don't understand why you did that.Quote:
1#
make list with the UIDs in the entity and load the items if the item for contains uid it's okay else delete it
2#
at the part of deleting the character before the shutdown make the UID = 0 for the items he have and then delete everything with UID = 0
i'm not sure eitherQuote:
What on Earth are you talking about? You don't need a select, then an update, then a delete for every single item. That's so much more expensive than just deleting in bulk as a single operation per table. What's your reasoning for that? I don't understand why you did that.
I work in the game industry doing planet scale game services, and this doesn't make sense to me. We don't do this; I've never done this; no company I've ever worked for has ever done this unless there are foreign key violations... in which case you have worse problems to deal with. So no, I don't think there's any "incredible reason" for doing this, unless it's "incredibly sloppy".Quote:
i'm not sure either
but probably there's something behind the scenes, and i feel it's incredible reason
when the delete the character set the UID at items table to 0Quote:
What on Earth are you talking about? You don't need a select, then an update, then a delete for every single item. That's so much more expensive than just deleting in bulk as a single operation per table. What's your reasoning for that? I don't understand why you did that.
I got what you said, but why are you saying this person should do all this just to delete items. I feel like you're setting up a Rube Goldburg machine for deleting characters. If you're concerned about adjusting indexes on delete (which you shouldn't be given the extremely small size and hopefully the caches you have in place for frequent reads/writes which this table shouldn't have), just partition your table correctly or bulk delete in batches. This is such a bizarre and ineffective way to try and "scrape" performance.Quote:
when the delete the character set the UID at items table to 0
and when loading it next time if the UID = 0 then delete it.
i don't know i think that's the first thing i got in my mind ..Quote:
I got what you said, but why are you saying this person should do all this just to delete items. I feel like you're setting up a Rube Goldburg machine for deleting characters. If you're concerned about adjusting indexes on delete (which you shouldn't be given the extremely small size and hopefully the caches you have in place for frequent reads/writes which this table shouldn't have), just partition your table correctly or bulk delete in batches. This is such a bizarre and ineffective way to try and "scrape" performance.
it was a joke and that why i called it incredible reasonQuote:
I work in the game industry doing planet scale game services, and this doesn't make sense to me. We don't do this; I've never done this; no company I've ever worked for has ever done this unless there are foreign key violations... in which case you have worse problems to deal with. So no, I don't think there's any "incredible reason" for doing this, unless it's "incredibly sloppy".