Hello,
Do you know why this simple query is taking so long to execute?
Do you know how to optimize it ?
exports.oxmysql:execute('SELECT * FROM abyssin WHERE angora=@angora',
{['angora'] = angora}, function(result)
if result[1] ~= nil then
for i=1, #result, 1 do
table.insert(tablex, {
title = result[i].title,
cat_link = result[i].cat_link,
charidentifier = result[i].charidentifier,
id = result[i].id,
})
end
end
:oxmysql] [DEBUG] took 0.741052ms to execute a query!
MySQL.single.await("SELECT column FROM table ORDER BY RAND()")
or MySQL.query.await("SELECT column FROM table ORDER BY RAND() LIMIT 1") should be the same thing
How can i config the collate? I got some Exceptions that means
[ script:oxmysql] Error: esx_vehicleshop was unable to execute a query!
[ script:oxmysql] Illegal mix of collations (utf8mb4_unicode_ci,IMPLICIT) and (utf8mb4_general_ci,IMPLICIT) for operation ‘=’
[ script:oxmysql] SELECT rented_vehicles.owner, rented_vehicles.rent_price, rented_vehicles.plate, users.accounts FROM rented_vehicles LEFT JOIN users ON rented_vehicles.owner = users.identifier []
I figured out that esx use “UTF8MB4_UNICODE_CI” and oxmsql uses “UTF8MB4_GENERAL_CI”. In build.js is an export for that but I don’t know how to config it that it will exports the correct collate? General = 45 and UNICODE = 224
oxmysql doesn’t use anything. Your tables are using separate collations, you need to alter everything and the database to use the correct one (utf8mb4_unicode_ci being the preferred choice).