Raised This Month: $ Target: $400
 0% 

Plugin Optimization Help KeyValues


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
pRED*
Join Date: Dec 2006
Old 04-26-2010 , 04:59   Re: Plugin Optimization Help KeyValues
Reply With Quote #1

Why not just use clientprefs? It abstracts all the database complexities (including threading), and provides caching as well.
pRED* is offline
Xaphan
SourceMod Donor
Join Date: Jun 2008
Old 04-26-2010 , 15:59   Re: Plugin Optimization Help KeyValues
Reply With Quote #2

Quote:
Originally Posted by pRED* View Post
Why not just use clientprefs? It abstracts all the database complexities (including threading), and provides caching as well.
I did try clientprefs awhile back, Foreach pref there was a new row. Again we would have around 57,000 rows.

Then I changed to use KV's, but that seems to be slowing.

sm_cookie uses 1 row per setting.

The idea was to minimize this to 1 db and 1 row per user.
Code:
CREATE TABLE `sm_preferences` (
  `auth_id` varchar(64) NOT NULL,
  `a_pref` int(11) DEFAULT '0',
  `b_pref` int(11) DEFAULT '0',
  `c_pref` int(11) DEFAULT '0',
  `d_pref` int(11) DEFAULT '0',
  `e_pref` int(11) DEFAULT '0',
  `f_pref` int(11) DEFAULT '0',
  `g_pref` int(11) DEFAULT '0',
  `h_pref` int(11) DEFAULT '0',
  `timestamp` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`auth_id`),
  UNIQUE KEY `auth_id` (`auth_id`)
)
__________________

Last edited by Xaphan; 04-26-2010 at 16:09.
Xaphan is offline
rhelgeby
Veteran Member
Join Date: Oct 2008
Location: 0x4E6F72776179
Old 04-26-2010 , 17:16   Re: Plugin Optimization Help KeyValues
Reply With Quote #3

How many rows there are in a DB is not important, but how the data is organized is. With proper layout in one or more tables, indexes and such it shouldn't be a problem.

Keyvalues are slow with larger amounts of data (~10+ KB), so I only use them for small configs.
__________________
Richard Helgeby

Zombie:Reloaded | PawnUnit | Object Library
(Please don't send private messages for support, they will be ignored. Use the forum.)
rhelgeby is offline
Send a message via MSN to rhelgeby
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:09.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode