just believe me. every single column mentioned in a where needs to be indexed. if you got where a = b and c = d, you index a and c in one index.
Otherwise the queries will be slow once the table size grows too large.
it does not matter how many rows he selects/manipulates, because mysql will search the entire table because it does not know where to look because it cannot use an index.
if the table is sufficiently large, the query will be sufficiently slow.
I just want to point out that indexing user_inventory solved his 1s updates on the user_inventory of a single row :P, odd, no? If that was having no effect.
Heâs not telling you to check any scripts or adjust them. Heâs telling you that the database table needs an index. That requires one line of code in the sql file.
Literally 30 seconds worth of typing and something that can be done by anyone that has already installed the resource.
Very sorry for the delay in responding. Not much cell signal in Cades cove
Thatâs exactly how youâd index a single colum. If, however, your most popular query was to grab a particular vehicle owned by the player, then consider indexing two columns:
ALTER TABLE `owned_vehicles` ADD INDEX `vehsowned` (`owner`,`plate`)
Script has worked perfectly for quiet some time. Im assuming as the owned_vehicles table started to grow bigger and bigger the problem occurs more and more. Owned vehicles will be replaced by some other vehicle. Possibly duplication of plates?
I can no longer get vehicles out of the garage as it throws this error:
[ 116546] Error running call reference function for resource esx_eden_garage: citizen:/scripting/lua/scheduler.lua:403: citizen:/scripting/lua/MessagePack.lua:862: extra bytes
[ 116546] stack traceback:
[ 116546] [C]: in function âerrorâ
[ 116546] citizen:/scripting/lua/MessagePack.lua:862: in field âunpackâ
[ 116546] citizen:/scripting/lua/scheduler.lua:626: in field âOpenâ
[ 116546] client/main.lua:203: in upvalue ârefâ
[ 116546] citizen:/scripting/lua/scheduler.lua:389: in function citizen:/scripting/lua/scheduler.lua:388
[ 116546] [C]: in function âxpcallâ
[ 116546] citizen:/scripting/lua/scheduler.lua:388: in function citizen:/scripting/lua/scheduler.lua:387
[ 116546] stack traceback:
[ 116562] [C]: in function âerrorâ
[ 116562] citizen:/scripting/lua/scheduler.lua:403: in function citizen:/scripting/lua/scheduler.lua:372
[ 116562] Error running system event handling function for resource es_extended: citizen:/scripting/lua/scheduler.lua:41: Failed to execute thread: citizen:/scripting/lua/MessagePack.lua:830: missing bytes
[ 116562] stack traceback:
[ 116562] [C]: in function âerrorâ
[ 116562] citizen:/scripting/lua/MessagePack.lua:830: in method âunderflowâ
[ 116562] citizen:/scripting/lua/MessagePack.lua:465: in field âanyâ
[ 116562] citizen:/scripting/lua/MessagePack.lua:860: in field âunpackâ
[ 116562] citizen:/scripting/lua/scheduler.lua:626: in field â?â
[ 116562] client/functions.lua:1304: in upvalue âhandlerâ
[ 116562] citizen:/scripting/lua/scheduler.lua:219: in function citizen:/scripting/lua/scheduler.lua:218
[ 116562] stack traceback:
[ 116562] [C]: in function âerrorâ
[ 116562] citizen:/scripting/lua/scheduler.lua:41: in field âCreateThreadNowâ
[ 116562] citizen:/scripting/lua/scheduler.lua:218: in function citizen:/scripting/lua/scheduler.lua:182
[ 116906] error during NUI callback menu_change: citizen:/scripting/lua/MessagePack.lua:862: extra bytes
[ 117250] error during NUI callback menu_submit: citizen:/scripting/lua/MessagePack.lua:862: extra bytes
[ 117437] error during NUI callback menu_submit: citizen:/scripting/lua/MessagePack.lua:862: extra bytes
[ 117609] error during NUI callback menu_submit: citizen:/scripting/lua/MessagePack.lua:862: extra bytes
[ 117781] error during NUI callback menu_submit: citizen:/scripting/lua/MessagePack.lua:862: extra bytes
It shows the list but unable to select any cars it does nothing and I have been unable to figure out why that is but it seems to have happened after I updated my es_extended.
could be possible but if you got plate duplicated would be very very rare 99999999 * 99999999 would be already 9999999800000001 different plates and i didn"t count the alfabet.
but what i did is limit to 20 vehicles per player. how long is you vehicle list ?
oh i know why it is doing that, if a player got like 50 vhehicles, in 1 variable he must stock 50 vehicles and do something with it. if uyou got message pack error it means it exeeds the number on length of the variable, so basicly to make it short that one player got too much cars. like saif befaore to prevent that, i do limit the number of vehicles per player
I have around 1,600 rows of vehicles. Im pretty sure a few players do have over 20 so that is most likely the issue. I wasnât aware of a vehicle cap at 20 but that makes perfect sense.
on my serevr i have 940 records. i do 20 vehicles for security, but i think you can make 25 or 30 of it just try if you got messagepack error, means you have too much vehicles for that player
ps look at the updtae it going to come, optimisation + renaming vehicles !!!
on the new version of garage2 people can always get their vehicle back of the impound, but if police put it in their impoundgarage you cannot take it from your impound, you must go to the polcie to get your car back
Ah okey, cause when i tested it yesterday i needed to have a mechanic in to get the vehicle out it seemed, im not so good at french (i think it is) so i didnât quite understand the text but i though you needed to have a mechanic (mecano) to get vehicle out of impound
well i am a player i get out the vehicle of my garage for some reason it dissabears, i can always get the vehicle pmyself in the (player)impound, but if police stops me because of high speed and the put my car in the policeimpound, well then to get my vehicle back, i must got to police so they git my vehicle back.
another example, if i get out my vehicle, it stays next to me, and i go to impount to get my vehicle back, it will way that the vehicle is somewhere in the city and go and get it, so it prevents vehcile duplication