drake
drake
CC#
Created by drake on 2/13/2024 in #help
basic mysql query takes around 170ms to complete
Hey, I'm working on a project that uses MariaDB. Currently I'm using MySqlConnector with Dapper and I just noticed that even a smallest query takes around ~170ms, it doesn't matter if the table has either 4 rows or 16k. I tried with and without Dapper because I thought that maybe dapper's mapping might takes that much time, but even with the simplest example it takes around that time. Can someone please enlighten me whats wrong with it or am I going crazy? In the below example both of the query takes as much time.
var statistics = connection.Query<PlayerStatisticsModel, AccountModel, PlayerStatisticsModel>(
"GetPlayerRaceStatistics",
(statistics, account) => { statistics.Player = account; return statistics; },
new { playerId = 1, mapId = "hAIffTh4fEWGCFeLGdenbw" },
splitOn: "id",
buffered: true,
commandType: System.Data.CommandType.StoredProcedure).ToList();

var statistics = connection.Query("SELECT * FROM `gm_race_playerstat`");
var statistics = connection.Query<PlayerStatisticsModel, AccountModel, PlayerStatisticsModel>(
"GetPlayerRaceStatistics",
(statistics, account) => { statistics.Player = account; return statistics; },
new { playerId = 1, mapId = "hAIffTh4fEWGCFeLGdenbw" },
splitOn: "id",
buffered: true,
commandType: System.Data.CommandType.StoredProcedure).ToList();

var statistics = connection.Query("SELECT * FROM `gm_race_playerstat`");
5 replies