Hi there,

I am having a problem understanding how limit works. As I thought limit
restricts the amount of results
to a given number. True.. the number of results is only that high how high I
specify it with limit.

But the querry takes as long as without limit. I am trying to avoid to long
waiting times if a user is
by exident searching for to many records.

This is my querry:

 SELECT c.*, p.province, co.country
 FROM test.cities c, test.provinces p, test.countries co
 WHERE c.city like 'd%'
  AND p.province_no = c.province_id
  AND p.country_c = c.country_c
  AND c.country_c = co.country_c
 ORDER BY country , province
 limit 0, 10

This takes 30 s on a 2.5 mio entries table

How could I really restrict the results to 10. So that mysql just returns
after 10 results?

Thanx, Andy

PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to