• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua How costly is this kind of operations (SQL)?

trollebror

Developer
Joined
Aug 8, 2009
Messages
362
Reaction score
58
Location
Sweden, Linköping
Hello OTLanders!
I'm wondering about exactly how efficient or inefficient is it to use this kind of database operations.

Lua:
function insertToSQL(accid, time, admin_id, comment)
	return db.executeQuery("INSERT INTO `someDataz` ... ")
end

function getBanAccInfo(acc)
	local info,qry = {},db.getResult("SELECT `someDataz` ...")
	if (qry:getID() ~= -1) then
		info = {qry:getDataInt("expires"), qry:getDataString("comment"), qry:getDataString("admin_id")}
	end
	return info
end

Let's say that one of these functions will get called as often as a rope.lua script would, would it be terrible bad? How would a efficient solution look like? Is there a way to store SQL-data in cache like the getPlayerStorageValue() is doing?
 
Back
Top