I have a table that contains a user_id, and an items field. The user_id is just an int with the user’s id, and the items is an xml structured object in a ‘text’ field. I want to be able to see statistics about the player items. i.e. who has the most of some item, the average wealth of everyone, etc.
I currently have to loop through each row and then again create a SimpleXMLElement and loop thru that and filter given a specific criteria.
The structure is like this:
inventory
if I want to do a query to count all of the items with item id 332 for example, this query takes like 3-4 seconds. We expect there to be 50k+ rows(currently 28k), so if there is any other way I can speed this process up, it would be great.
what about using mysql like ?
for example