xorm查询com_stmt_prepare exec close 一样多的情况 #1496
Labels
No Label
backport/done
backport/v1
blocked
db
oracle
db
sqlserver
duplicate
feature
cache
frontport/done
frontport/main
invalid
kind
breaking
kind
bug
kind
build
kind
dependencies
kind
docs
kind
driver
kind
enhancement
kind
feature
kind
performance
kind
proposal
kind
question
kind
refactor
kind
testing
need
feedback
need
test
proposal:accepted
RaspBerry Pi
regression
skip-changelog
upstream
wip
wontfix
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: xorm/xorm#1496
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
如下图,
代码:
var XormDb *xorm.Engine
func init() error {
var err error
}
result,err := XormDb.Where("user_bind_status = ? " ,1).Where("code = ? " ,deviceCode).Get(&info)
简单的查询压测,使用200个线程,发现go操作数据库是每次查询都会做一次com_stmt_prepare exec close ,并没有预处理语句复用的效果,请问这是go的设计如此吗?
You could use
Prepare()
and withsession
to do that.我加了下prepare,看压测的情况依旧是还有很多prepare,close。。。是我写错了吗
result,err := XormDb.Prepare().Where(“user_bind_status = ? ” ,1).Where(“code = ? ” ,deviceCode).Get(&info)