Perhaps doing your queries to return only some instead of all records
will help, a great module for doing this is:

http://search.cpan.org/perldoc?Data::Paginate



I am using a limit clause and the sql query returns at most 20 records, but
when very many records are found, the search is very slow, even if it
returns only 20.

I know how many of them are found, because I use found_rows() in order to

perldoc -f found_rows
perldoc DBI
perldoc DBD::mysql

have no refernce to that function?

Care to reference found_rows()'s docs?

show how many records would be found if no limit clause would be used.

Depending on the DB it may or may not matter "speed"-wise(MySQl's LIMIT is much more efficient than Postgre's for example) the point for the OP was this:

pagination will help your script be faster in the sense that the array of records its working with is 20 instead of 20,000,000 (IE independant of how efficient the DB is with a proper query, which is not a perl issue in the least)

it also makes it easier to use for your end user, but thats a UI issue.

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to