You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While using gorm a select of a small struct(29 members) takes almost 400ms, When using phpmyadmin, database/sql or the mysql cli it's only around 6ms. Every table has a primary key as index. Is there something wrong with my setup?
using gorm:
raw:
my gorm function:
func GetUserById(id int) User {
var ret User
db.Preload(clause.Associations).First(&ret, "id = ?", id)
return ret
}
Yep, that solved the issue thanks. I thought that the time that gorm shows me is only for the single query and doesnt include the time taken to fetch the associations.
Your Question
While using gorm a select of a small struct(29 members) takes almost 400ms, When using phpmyadmin, database/sql or the mysql cli it's only around 6ms. Every table has a primary key as index. Is there something wrong with my setup?
using gorm:

raw:

my gorm function:
my gorm config:
Expected answer
Is this expected/normal behaviour? If no, what are possible solutions to this?
The text was updated successfully, but these errors were encountered: