Solved

too slow

Posted on 2002-05-28
2
200 Views
Last Modified: 2010-03-05
hi,

I am using perl dbi to connect to mysql and get the number of rows of a table using the following code:

$sql2=qq{select * from tutorf};
$sth2=$DBH->prepare($sql2);
$sth2->execute();
$row2=$sth2->rows();
$sth2->finish;

there is total 8000 rows in the table.
The problem is the speed of this code is very slow!!!

any method i can speed up it?
0
Comment
Question by:klnhk
2 Comments
 
LVL 4

Accepted Solution

by:
dda earned 50 total points
ID: 7038965
'select count(*) from table' will go.
0
 
LVL 8

Expert Comment

by:inq123
ID: 9512423
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Accept a comment by dda

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

inq123
EE Cleanup Volunteer
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
In the distant past (last year) I hacked together a little toy that would allow a couple of Manager types to query, preview, and extract data from a number of MongoDB instances, to their tool of choice: Excel (http://dilbert.com/strips/comic/2007-08…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now