Thread: Better ATTR's
View Single Post
  #15  
Old 07-27-2011, 11:06 PM
Hezzy002 Hezzy002 is offline
Registered User
Join Date: Jul 2011
Posts: 247
Hezzy002 is a jewel in the roughHezzy002 is a jewel in the rough
Quote:
Originally Posted by fowlplay4 View Post
You really aren't making it easier for SQL though. It's still going to have to do that exact same check if the table exists.

Your table should just be:

account
flag
value

add an index to account and you're good to go.

Your attempt at making it more efficient by giving each account their own table is actually much more in-efficient.

If you have 10 people online and you call shareVars on one person, you're calling around 12+ queries (and triggers too) in one call.

If you made your table properly, you could use one query to get everyone's flag and variables. I.e:

SELECT account, name, value
FROM flags
WHERE account IN ('account1', 'account2')

Package the result up and send it to your client.
That's true, I hadn't thought about that case. I'll modify it, then. I don't see any problem with the triggers, it's no different than sending a packet, isn't it?
Reply With Quote