在C#中使用ODBC连接非常缓慢地从MYSQL表读取数据 [英] Reading data from MYSQL table very Slowly using ODBC connection in C#

查看:190
本文介绍了在C#中使用ODBC连接非常缓慢地从MYSQL表读取数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已使用ODBC连接从MYSQL表填充数据
在查询中,将使用三个表的联接,然后填充数据,所有三个组合表行均为20729378.
当我将使用dataadapter填充数据集时,则需要大量时间来填充数据.将近半小时或没有响应任何时间来快速读取数据的任何方法.

在此先感谢........

I have fill the data from the MYSQL table using ODBC connection
in query I will be used the joins of the three tables then fill the data & all three combine table rows is 20729378 .
when i will be filled the dataset using dataadapter then it takes lots of time to fill data. near about half hour or not responding some time any method to read the data fast.

Thanks in advance........

推荐答案

关于从数据库中检索大量数据的建议是使用DataReader而不是一个数据适配器.这将大大加快速度.第二点,您实际上应该为MySQL使用ADO.Net连接器,而不是使用OBDC.此处 MySQL Connector .Net [
My advice with regards to retrieving vast amounts of data from a database, would be to use a DataReader instead of a DataAdapter. This will speed things up considerably. On a second note, you should really be using the ADO.Net connector for MySQL rather than using OBDC. Here MySQL Connector .Net[^] is the download page.

Hope this helps


我不奇怪这会花费时间:在DataAdapter中组合20,000,000行是非常愚蠢的.为什么要一次检索所有行?为什么不一次检索一个或一次检索一个页面呢?您与他们同时需要所有这些行的工作是什么?
I''m not surprise it takes time: 20,000,000 rows combining in a DataAdapter is very silly. Why retrieve all the rows at once? Why not retrieve them either one at a time, or a page at a time? What are you doing with them that needs all those rows at the same time?


您需要使用事务.我遇到了同样的问题,开始交易使其速度提高了500倍.
You need to use transactions. I was having same problem, starting transaction make it 500 time faster.


这篇关于在C#中使用ODBC连接非常缓慢地从MYSQL表读取数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆