On Jul 28, 2004, at 7:08 PM, Joost Kraaijeveld wrote:
> select customer.id, customer.name, orders.id
> from customers, orders
> order by customer.id, orders.id
> limit 25
>
> The query runs forever (the longest I let it run is 500 seconds).
You have no join condition, so it's doing a full cartesian join (17518
x 88393 = 1,548,468,574 rows before the limit). Try this:
select customer.id, customer.name, orders.id
from customers c, orders o
where c.id = o.customerid
order by customer.id, orders.id
limit 25
Michael Glaesemann
grzm myrealbox com