Posts: 966
Threads: 5
Joined: Jul 2011
Reputation:
0
Why on earth do you need 180 gramX fields, anyways? What does each zero stand for?
Posts: 966
Threads: 5
Joined: Jul 2011
Reputation:
0
Okay, well, I think some experimenting would be allowed in this case and never having written a script related to drug handling myself, I can point out that maybe the amount of data stored in each field can be reduced, because what the first zero stands for can easily be implemented in the second zero, or the other way around.
So the zero would stand for its availability and type at the same time. If the availability is 0, then it cannot be used or w/e. If it is 1, then the type is stale, and 2 is freshly grown.
But I suppose this would not actually cut down much on the time it takes to retrieve the data, so I'm thinking that you maybe should have one huge text field (VARCHAR if you know what the limit will be). Not only does this make your amount of drug grams on the server virtually unlimited (well, I don't know if that's a good thing for your economy or not), but also might make the data loading faster, because 181 fields is an awful lot to take care of at once depending on your SQL server & tables set up.
Test it out with one huge field containing all the drug information for the player - perhaps you could even integrate it into your main players table at a later point to get rid of one query if this method proves to be worthy. What you have to do with the current setup is parse the field and that takes some time as well depending on your method. With the updated method, parsing is of course involved, as well, even at a more difficult level but I suppose you can handle it.