Optimizing database calls

How to optimize database calls.

triangle-exclamation

About

Garages by default uses simple logic that refreshes vehicles list per every call to open garage/impound. To make it more efficient we've enabled more optimal way to access database when needed.

Disabling vehicle refresh list per call

Headover to the /shared/config.lua and set:

Config.GatherVehiclesListOnEachExecute = false

Finding resources

Since you've disabled the automatic refresh, you need to call it manually when update for vehicle takes place. For that matter you need to find which scripts on your server could manipulate (update/insert) data for either player_vehicles or owned_vehicles table (dependable on the framework you've got).

Types of the resources that might be handling any data

Resource type
About

Dealership/Vehicleshops

Player is allowed to buy vehicle from the store, inserts new data to the table.

Rewards Systems

Player might receive reward of new vehicle, inserts new data to the table.

Server Monetization

Players that might receive some unique vehicle from your server store, inserts new data to the table.

Tuning Scripts

If your tuning resource contains logic such as changing plate text updates data to the table.

Fake plate Systems

Some fake plate resources might apply change to the plate column, updates data to the table.

Adding refresh export

If you've found out which resources applies changes to the table, make sure that server sided part is open source in order to apply the export.

Example of the code

Last updated