[Plugin] [REL] MySQL Plugin (Now on github!)

Quote:
Originally Posted by Pain123
Посмотреть сообщение
And does anyone misses unthreaded queries, thus queries without using callbacks (public's)?
I'm using mysql for 2 years on my server, I was at first skeptical and lazy to convert to the threaded queries, but now I would never go back. They are easy to use when you get a hang on them and really increase the performance and response of the server, so in my opinion you shouldn't waste time re-implementing non-threaded queries.
Reply

Quote:
Originally Posted by kamilot73
Посмотреть сообщение
Hm, r20 is stable? Most interesting stability on Linux,Ubuntu 13.04
My test server is running on Linux, Debian 7 for 1 week now with mysql R20 without any crashing and with enabled mutex, so I think it is stable.

Quote:
Originally Posted by Gigi-The-Beast
Посмотреть сообщение
I'm using mysql for 2 years on my server, I was at first skeptical and lazy to convert to the threaded queries, but now I would never go back. They are easy to use when you get a hang on them and really increase the performance and response of the server, so in my opinion you shouldn't waste time re-implementing non-threaded queries.
Allright, so I won't reimplement them. I tought maybe then more people would be attracted to the plugin, but reimplementing it would be a big change and it would mean that many scripts would become incompatible.
Thanks for the answers.

The next feature in the coming revision is the ability to set caching as always enabled. That would mean that the cache-parameter in the query-native will be ignored and the queries always cached. And the mysql_-functions would also access the cache instead of the raw mysql_-functions inside the plugin.
In short: more performance and no incompatibility. (all mysql_-functions would do the same as the cache-functions)
What do you think about it?
Reply

Hm. Some question. How I can use cache_save or cache_delete for optimization?
Reply

Imagine you want to create a dialog which lists all of your cars and if you click on one of the car you get another dialog where you can edit it.
Without cache_save and _delete you would first send a query, then use the result to display the list dialog. After the player chooses the car, you would have to send the same query again and then get the car-data.
With cache_save and _delete you send a query, save the result with cache_save and display the list dialog. After the player chooses the car, you set the saved cache as active and get the car-data.
With cache_save you saved a query. That's one example how these new functions can be used for optimization.
Reply

Ok sorry, that was assuming, to whoever did that then.

This.

Quote:
Originally Posted by Pain123
View Post
@RealCop228, just be careful to make your variables big enough to hold all the data. If the data which is getting stored is too big for the variable or the destination variable is rather too small, then memory gets overwritten. With enough luck it was important memory and the server crashes, but in the normal case other variables will suddenly have a different value.
Reply

Quote:
Originally Posted by Kar
View Post
Ok sorry, that was assuming, to whoever did that then.

This.
Yeah, I've read that already. I should be OK, I'll just have to be extra cautious. Who knows, though. I MAY update my threaded callbacks eventually. For now, though, this seems to be working fine; even after some extensive testing.
Reply

Just be careful with huge strings
Reply

Quote:
Originally Posted by Kar
View Post
Just be careful with huge strings
Yeah ofc. thanks for your concern anyway.
Reply

Just out of interest, how many tables do you actually have, RealCop? I'm at 30 tables right now, with some 10-ish being frequently accessed.
Reply

40 tables, about 16 or more being frequency accessed; excluding the ones for the UCP. The amount of tables I have will continue to grow because like I said, almost everything is dynamic. :P
Reply

When I want to format a string to use in a query, which is the "better" way to do it, mysql_format or just the format function?
Reply

The normal format function should be faster and precisions work there as expected, but if you want to escape strings in your query, mysql_format is the better way to do it.
Reply

Quote:
Originally Posted by Pain123
View Post
The normal format function should be faster and precisions work there as expected, but if you want to escape strings in your query, mysql_format is the better way to do it.
Alright thanks, I'll stick with the standard format function. One more question, what is the "LIMIT" thing in the mysql_query function?
Reply

Quote:
Originally Posted by Finn707
View Post
Alright thanks, I'll stick with the standard format function. One more question, what is the "LIMIT" thing in the mysql_query function?
It limits the amount of rows returned to whatever you set. If you only want to load 5 of the last recorded logs, you could add LIMIT 5 at the end of the query.
Reply

Didn't even see IstuntmanI's post lol.

Well, it might be good to keep them i mean you never know, someone might need them, the more the merrier.

Your choice
Reply

If it doesn't "hurt" the plugin, it's okay to keep it, more functions, the better. It could be useful when someone wants to modify charset of all tables. It's easier with that function.
Reply

Allright, I'll leave that functions in the plugin.


I did some more benchmarking on Windows and Linux with R20 and R21.

Fetching 10000 rows with 7 fields each row:
Quote:

Windows:

R20 - 11304 ms
R21 - 4852 ms
Improvement: 133%


Linux:

R20 - 7710 ms
R21 - 5256 ms
Improvement: 47%

Fetching 10 rows with 7 fields each row:
Quote:

Windows:

R20 - 504 ms
R21 - 53 ms
Improvement: 851%

Linux:

R20 - 575 ms
R21 - 39 ms
Improvement: 1374%

Well, that surprised even me.
Reply

Oh my...

I love you ... your codding I mean. When will R21 be released ? I can't wait for these improvements, especially that in my computer I load the server database from the server host and I love speed. I will do some comparations too when it will be released (before and after, all things which I load on init, in my computer then on host).
Reply

Update will be a awesome, I just wait R21 =)
Reply

How can there be a 113% improvement for windows but only 47% on linux, it doesn't add up...
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)