|
|
| <prev next> |
Choosing A Webhost: |
Slow retrieval from DB: msg#00000db.mysql.c++
Hello, I'm using the MySQL++ to place strings into an array. The database has about 100K records. It takes about 2-3 minutes to access the database and put all the strings into the array. The database server is MySQL. The machine is an Intel Celeron with 128 MB of RAM with a 100BaseT connection. My code is shown below: // Inputs data from table "strings" through a remote DB connection char** GetData(int &dataCnt) { char** data; dataCnt = 0; Connection con(use_exceptions); con.connect("test", "home", "teddy", "bear"); Query query = con.query(); query << "select * from strings"; Result res = query.store(); Row row; data = new char*[res.size()]; Result::iterator i; for (i = res.begin(); i != res.end(); i++) { row = *i; data[dataCnt] = new char[strlen(row[0])]; strcpy(data[dataCnt], row[0]); dataCnt++; } return data; } Is this length of time to be expected for database access with the API or is there a faster way to code this? Thanks, Joe __________________________________ Do you Yahoo!? Yahoo! Mail is new and improved - Check it out! http://promotions.yahoo.com/new_mail -- MySQL++ Mailing List For list archives: http://lists.mysql.com/plusplus To unsubscribe: http://lists.mysql.com/plusplus?unsub=gcdmc-plusplus@xxxxxxxxxxx
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Next by Date: | can't compile, Arlen Nascimento |
|---|---|
| Next by Thread: | Re: Slow retrieval from DB, sinisa |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
Free MagazinesCisco NewsReceive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business. subscribe Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field. subscribe The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business. subscribe Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company. subscribe Total Telecom Total Telecom is "The Economist of the communications industry". subscribe |