|
You last visited: Today at 04:05
Advertisement
can anyone give me tip how to delete all items etc.. if character is deleted
Discussion on can anyone give me tip how to delete all items etc.. if character is deleted within the CO2 Programming forum part of the Conquer Online 2 category.
10/26/2019, 22:39
|
#1
|
elite*gold: 0
Join Date: Oct 2006
Posts: 557
Received Thanks: 76
|
can anyone give me tip how to delete all items etc.. if character is deleted
can anyone give me tip how to delete all items, skill, prof, itemadd etc.. if character is deleted?
|
|
|
10/26/2019, 23:42
|
#2
|
elite*gold: 12
Join Date: Jul 2011
Posts: 8,282
Received Thanks: 4,191
|
Quote:
Originally Posted by marcbacor6666
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
|
#3
|
elite*gold: 0
Join Date: Mar 2014
Posts: 37
Received Thanks: 7
|
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
|
#4
|
elite*gold: 12
Join Date: Jul 2011
Posts: 8,282
Received Thanks: 4,191
|
Quote:
Originally Posted by Ahmed El5WaGa
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
|
#5
|
elite*gold: 0
Join Date: Sep 2016
Posts: 25
Received Thanks: 6
|
Quote:
Originally Posted by Spirited
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
|
#6
|
elite*gold: 12
Join Date: Jul 2011
Posts: 8,282
Received Thanks: 4,191
|
Quote:
Originally Posted by felixanius
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
|
#7
|
elite*gold: 0
Join Date: Mar 2014
Posts: 37
Received Thanks: 7
|
Quote:
Originally Posted by Spirited
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
|
#8
|
elite*gold: 12
Join Date: Jul 2011
Posts: 8,282
Received Thanks: 4,191
|
Quote:
Originally Posted by Ahmed El5WaGa
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
|
#9
|
elite*gold: 0
Join Date: Mar 2014
Posts: 37
Received Thanks: 7
|
Quote:
Originally Posted by Spirited
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
|
#10
|
elite*gold: 0
Join Date: Oct 2019
Posts: 7
Received Thanks: 2
|
Hmmmm interesting af.
|
|
|
10/28/2019, 03:22
|
#11
|
elite*gold: 0
Join Date: Oct 2006
Posts: 557
Received Thanks: 76
|
thank you so much for replying to my post.
|
|
|
10/29/2019, 02:20
|
#12
|
elite*gold: 0
Join Date: Sep 2016
Posts: 25
Received Thanks: 6
|
Quote:
Originally Posted by Spirited
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
|
#13
|
elite*gold: 12
Join Date: Jul 2011
Posts: 8,282
Received Thanks: 4,191
|
Quote:
Originally Posted by felixanius
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
|
|
|
All times are GMT +1. The time now is 04:07.
|
|