session_find.go noCacheFind性能问题 #2042

Open
opened 3 months ago by Mr1X · 3 comments
Mr1X commented 3 months ago

engine.Find()方法
调试发现

耗时函数
func (session *Session) noCacheFind(table *core.Table, containerValue reflect.Value, sqlStr string, args ...interface{}) error {}

for rows.Next() {} 耗时几秒以上

结果集4511条数据,大小 1.55MB

反射结果集的时候存在性能问题

engine.Find()方法 调试发现 耗时函数 func (session *Session) noCacheFind(table *core.Table, containerValue reflect.Value, sqlStr string, args ...interface{}) error {} for rows.Next() {} 耗时几秒以上 结果集4511条数据,大小 1.55MB 反射结果集的时候存在性能问题
Owner

How many records do you fetch? And please upgrade your xorm version.

How many records do you fetch? And please upgrade your xorm version.
lunny added the
need/feedback
label 3 months ago
Poster

How many records do you fetch? And please upgrade your xorm version.

table total record: 94476
select result record: 4511
result size: 1.5MB

I tried it yesterday on xorm.io/xorm v1.2.3
it also slow, and I checked that the key source code is the same

func (session *Session) noCacheFind

I'm sure there's a performance problem here for rows.Next() {}
Please see the logfile and search TODO and other Important logs like 111111, 222222, 33333

> How many records do you fetch? And please upgrade your xorm version. table total record: 94476 select result record: 4511 result size: 1.5MB I tried it yesterday on `xorm.io/xorm v1.2.3` it also slow, and I checked that the key source code is the same > func (session *Session) noCacheFind I'm sure there's a performance problem here `for rows.Next() {}` Please see the logfile and search `TODO` and other Important logs like `111111`, `222222`, `33333`
Owner

rows.Next is a simple wrap of database/sql, So I think if there is a performance problem. It's upstream related.

`rows.Next` is a simple wrap of `database/sql`, So I think if there is a performance problem. It's upstream related.
lunny added the
kind/upstream
label 2 months ago
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.