can anyone give me tip how to delete all items etc.. if character is deleted

10/26/2019 22:39 marcbacor6666#1
can anyone give me tip how to delete all items, skill, prof, itemadd etc.. if character is deleted?
10/26/2019 23:42 Spirited#2
Quote:
Originally Posted by marcbacor6666 View Post
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.
10/26/2019 23:44 Ahmed El5WaGa#3
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
10/27/2019 01:04 Spirited#4
Quote:
Originally Posted by Ahmed El5WaGa View Post
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
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.
10/27/2019 05:53 felixanius#5
Quote:
Originally Posted by Spirited View Post
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'm not sure either
but probably there's something behind the scenes, and i feel it's incredible reason
10/27/2019 06:25 Spirited#6
Quote:
Originally Posted by felixanius View Post
i'm not sure either
but probably there's something behind the scenes, and i feel it's incredible reason
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".
10/27/2019 10:10 Ahmed El5WaGa#7
Quote:
Originally Posted by Spirited View Post
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.
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.
10/27/2019 11:18 Spirited#8
Quote:
Originally Posted by Ahmed El5WaGa View Post
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 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.
10/27/2019 11:41 Ahmed El5WaGa#9
Quote:
Originally Posted by Spirited View Post
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.
i don't know i think that's the first thing i got in my mind ..
anyway of course you know better than me.. :)
10/27/2019 12:03 territorya99#10
Hmmmm interesting af.
10/28/2019 03:22 marcbacor6666#11
thank you so much for replying to my post. :handsdown:
10/29/2019 02:20 felixanius#12
Quote:
Originally Posted by Spirited View Post
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".
it was a joke and that why i called it incredible reason
something like carrying coals to Newcastle lol
10/29/2019 02:42 Spirited#13
Quote:
Originally Posted by felixanius View Post
it was a joke and that why i called it incredible reason
something like carrying coals to Newcastle lol
Ah, sorry. I'm incredibly dense with social cues. Hahaha