ODBC 与 MySQLClient

发布于 2024-08-31 01:59:19 字数 115 浏览 4 评论 0原文

我目前正在使用 C# 使用 ODBC 连接到我的 MySQL 数据库。有人告诉我,使用 MySql Connector 会更好、更快,而且不依赖于 Windows。有人可以解释一下吗?到目前为止我在网上找不到任何东西

I'm currently using ODBC to connect to my MySQL database, using C#. I've been told that using the MySql Connector would be better, and faster, and not dependent on Windows. Can someone shed some light on this please? I've been unable to find anything on the net so far

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

围归者 2024-09-07 01:59:19

我不确定你要问什么。但是 ODBC 是通用提供程序,而 mysql 提供程序是特定于 mysql 数据库的。因此,特定的提供程序可以针对 mysql 进行更优化,并更好地执行。 ODBC 和 mysql 提供程序均可用于 mono(linux、unix)和 .net(windows),但始终建议使用特定的提供程序(如果有)。

I'm not sure what you are asking for tbh. But ODBC is a generic provider while the mysql provider is specific for mysql db. Therefore the specific provider could be more optimized towards mysql and preform better. Both ODBC and the mysql provider is available for mono (linux, unix) and .net (windows) but it's always recommended to use the specific provider if there is one.

在你怀里撒娇 2024-09-07 01:59:19

编写一个测试应用程序(嗯,我想是两个应用程序 - 一个用于 ODBC,一个用于 MySql Connector)并测量性能差异。确保在运行之间刷新缓存/烧香/向您选择的一个或多个神献祭/等等(不知道这在 MySql 上是否可能/必要)。过去,我曾使用其他数据库访问工具完成此操作(减去焚香和牺牲,因此结果可能会无意中出现偏差),并发现 ODBC 增加了运行时开销,范围从简单、快速查询的 5% 到复杂的有效无开销,长时间运行的查询。 YMMV。

分享并享受。

Write a test application (well, two applications, I suppose - one for ODBC and one for MySql Connector) and measure the performance difference. Make sure you flush caches/burn incense/sacrifice to the god or gods of your choice/etc (don't know if this is possible/necessary on MySql) between runs. In the past I've done this (minus the incense and sacrifices, so results may have been inadvertently skewed) with other database access tools and found that ODBC added runtime overhead ranging from 5% on simple, quick queries to effectively no overhead on complex, long-running queries. YMMV.

Share and enjoy.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文