19.06.2018, 13:14
Quote:
The database structure you are describing has many flows:
• 50 unused columns • duplicates Try to maintain 15-20 columns per table and not more. Having the same item multiple times when can be combined into one is not good either. The ideal database structure would be like the current one: <userid>, <itemid>, <amount> But instead of sending a DELETE query and multiple INSERT, combine them. A player can have an item only once so <userid>, <itemid> is a UNIQUE constraint. If set like this, when executing a query such: pawn Код:
• Insert a new record if it does not exist. • Update amount of item for X player and Y item. |