which is the maximum length of a string?
#1

which is the maximum length of a string for a query
like
mysql_format
or format

string[2048] ? or 4096 or bigger?
Reply
#2

https://san-andreas-multiplayer-samp...om/wiki/Limits Although I am not sure why would you need to make such a big string.
Reply
#3

Why do you need such a big string size ?
Reply
#4

i make a optimized save system, save all variables in database after 5 6 minutes on server.
if you save all data always you have a lot of queries, and queries affect the server
Reply
#5

Well actually i think it's completely the opposite. Sending multiple short queries is way more efficient than having a huge query run every 5 - 6 minutes. Imagine having to send a 512 or even 1024 sized query for 100 players at the same time. The server won't really appreciate it.
Reply
#6

Quote:
Originally Posted by Adamoneoone
View Post
Well actually i think it's completely the opposite. Sending multiple short queries is way more efficient than having a huge query run every 5 - 6 minutes. Imagine having to send a 512 or even 1024 sized query for 100 players at the same time. The server won't really appreciate it.
i have to update like 230 variables in database, i think one string is better then 230
Reply
#7

It’s even worse imo.. but you do you lel
Reply
#8

Having a huge query to save account flags in a single table is fine. It's not ideal, but it's *fine*. Long as you know what you're doing the worst thing that'll happen is it just being annoying to work with.

As for the question, the limit for how long a string can be is so large it should not matter (and if you do reach it, the compiler will let you know). Of course, certain natives which utilize strings will have smaller limits. For those you should check the Limits in the afforementioned Limits wiki link, or in case of a plugin, it's documentation.
Reply
#9

So how to do?
1 2 3 query with 230 variables or 230 query?
You have have 100 players you have 23000 queries on 5 minute
Or 100 queries on 5 minute
I think one is good
Reply
#10

A better question is, do those variables are changing in same time? Or do they mean same thing? Because you can just update the variable only when it changes. I doubt a player admin level or player level changes so often or needs to be saved every so often
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)