[RE-RELEASE] esx_eden garage2: 3 in 1 garage

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. :stuck_out_tongue:

1 Like

i must have a closer look at it then but yet so much to do no time atm to check ell the scripts and adjust them :’)

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.

2 Likes

something like this ?

ALTER TABLE owned_vehicles ADD INDEX(owner);

Very sorry for the delay in responding. Not much cell signal in Cades cove :slight_smile:

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`)

thx, i should maybe change the script with plate as id but not the time for it :frowning:

Getting tons of players with replaced vehicles in their garage by other vehicles. Im assuming its related on how the vehicles are being indexed

I don’t follow you what is going wrong and what did you do? :wink:

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.

1 Like

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

1 Like

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.

1 Like

on my serevr i have 940 records. i do 20 vehicles for security, but i think you can make 25 or 30 of it :slight_smile: just try if you got messagepack error, means you have too much vehicles for that player :slight_smile:

ps look at the updtae it going to come, optimisation + renaming vehicles !!!

Sounds awesome…Thanks for the reply back and look forward to many more releases from you :slight_smile:

update is done on esx_eden_garage2 :slight_smile:

but still need to make it compatible for new vehicleshop with index of plate , not no time atm :frowning:

thx for your support :stuck_out_tongue:

2 Likes

I downgraded to a older version of vehicleshop and esx_eden_garage1 cause nothing else worked with new vehicleshop.

However, is there any way to disable the mechanic at eden_garage2 and have it like in 1 where you need to just go to the impound to get the vehicle?

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