go-sql-driver / mysql

Go MySQL Driver is a MySQL driver for Go's (golang) database/sql package
https://pkg.go.dev/github.com/go-sql-driver/mysql
Mozilla Public License 2.0
14.54k stars 2.32k forks source link

Support CLIENT_OPTIONAL_RESULTSET_METADATA #1105

Open ybbct opened 4 years ago

ybbct commented 4 years ago

Issue description

This option will improve performance in many scenarios https://dev.mysql.com/worklog/task/?id=8134

https://www.facebook.com/weixiang.zhai/posts/678596755543802

julienschmidt commented 4 years ago

The flag is not documented here: https://dev.mysql.com/doc/internals/en/capability-flags.html

According to the "Low Level Design" part of the worklog, the following is used:

#define CLIENT_OPTIONAL_RESULTSET_METADATA (1UL << 25)

Further source: https://dev.mysql.com/doc/refman/8.0/en/c-api-optional-metadata.html

Bisstocuz commented 3 years ago

The flag is not documented here: https://dev.mysql.com/doc/internals/en/capability-flags.html

According to the "Low Level Design" part of the worklog, the following is used:

#define CLIENT_OPTIONAL_RESULTSET_METADATA (1UL << 25)

Further source: https://dev.mysql.com/doc/refman/8.0/en/c-api-optional-metadata.html

It's right, this option will improve performance in many scenarios with up to 180% QPS performance improvement. https://dev.mysql.com/doc/c-api/8.0/en/c-api-optional-metadata.html

Is it possible for github.com/go-sql-driver/mysql to support this feature?