SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 27/04/2020, 09:01 PM   #1
rockys
Big Clucker
 
Join Date: Oct 2018
Location: pawn
Posts: 67
Reputation: 0
Default which is the maximum length of a string?

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

string[2048] ? or 4096 or bigger?
rockys is offline   Reply With Quote
Old 27/04/2020, 09:10 PM   #2
TopShooter2
Big Clucker
 
TopShooter2's Avatar
 
Join Date: Feb 2017
Posts: 151
Reputation: 70
Default Re: which is the maximum length of a string?

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


A new Heavy Roleplay server.
Forums | Discord
TopShooter2 is offline   Reply With Quote
Old 27/04/2020, 09:15 PM   #3
PawnFox
Huge Clucker
 
PawnFox's Avatar
 
Join Date: Feb 2012
Location: Romānia
Posts: 257
Reputation: 15
Default Re: which is the maximum length of a string?

Why do you need such a big string size ?
PawnFox is offline   Reply With Quote
Old 27/04/2020, 11:22 PM   #4
rockys
Big Clucker
 
Join Date: Oct 2018
Location: pawn
Posts: 67
Reputation: 0
Default Re: which is the maximum length of a string?

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
rockys is offline   Reply With Quote
Old 28/04/2020, 07:25 AM   #5
Adamoneoone
Huge Clucker
 
Join Date: Sep 2014
Posts: 488
Reputation: 37
Default Re: which is the maximum length of a string?

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.
Adamoneoone is offline   Reply With Quote
Old 28/04/2020, 10:00 AM   #6
rockys
Big Clucker
 
Join Date: Oct 2018
Location: pawn
Posts: 67
Reputation: 0
Default Re: which is the maximum length of a string?

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
rockys is offline   Reply With Quote
Old 28/04/2020, 10:05 AM   #7
Adamoneoone
Huge Clucker
 
Join Date: Sep 2014
Posts: 488
Reputation: 37
Default Re: which is the maximum length of a string?

It’s even worse imo.. but you do you lel
Adamoneoone is offline   Reply With Quote
Old 28/04/2020, 11:53 AM   #8
Markski
Big Clucker
 
Markski's Avatar
 
Join Date: Apr 2015
Location: La Plata, Argentina
Posts: 133
Reputation: 59
Default Re: which is the maximum length of a string?

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.
Markski is offline   Reply With Quote
Old 28/04/2020, 12:21 PM   #9
rockys
Big Clucker
 
Join Date: Oct 2018
Location: pawn
Posts: 67
Reputation: 0
Default Re: which is the maximum length of a string?

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
rockys is offline   Reply With Quote
Old 28/04/2020, 01:10 PM   #10
Banditul18
Huge Clucker
 
Join Date: Nov 2014
Location: Brasov,Romania
Posts: 405
Reputation: 32
Default Re: which is the maximum length of a string?

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
Banditul18 is offline   Reply With Quote
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Line length? String length? Denying Scripting Help 2 14/05/2014 07:04 PM
What is the maximum length for string Variable? yxliang Scripting Help 12 06/05/2013 01:55 PM
Isn't 128 the maximum length for sent client messages? 2KY Scripting Help 5 03/01/2013 06:41 AM
make a maximum name length...? sciman001 Help Archive 10 22/04/2011 07:50 PM
Pawn Maximum String Length? mprofitt Help Archive 3 25/11/2009 03:32 PM


All times are GMT. The time now is 03:35 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.