I have this query that returns me all the POIs in a given area:
$query = $em ->createQuery( 'SELECT f FROM MyApplication\MyBundle\Entity\POI p WHERE (p.latitude BETWEEN :southEastLatitude AND :norhtWestLatitude) AND (p.longitude BETWEEN :southEastLongitude AND :norhtWestLongitude) ORDER BY p.name '); $query->setParameter(":norhtWestLatitude", $northWestLat); $query->setParameter(":norhtWestLongitude", $northWestLng); $query->setParameter(":southEastLatitude", $southEastLat); $query->setParameter(":southEastLongitude", $southEastLng);
If I try to access with a small area (with parameters with slight differences), I successfully get the result. I think I get the result up to 1000 lines ... I'm not quite sure.
If I try to access with a larger area, I get an empty result set ...
Having somehow fired the same request with the parameters of a larger area, I get the correct set of results (~ 1060 rows).
So I'm curious about the limitations of the doctrine (or even Symfony ??? I use the doctrine in my Symfony2 project), are there any? I also tried $query->setMaxResults(999999999); , but it did not help...
Has anyone had the same problem?
Edit: Maybe php memory usage should be high? I added these lines before and after getresult:
echo "Memory usage before: " . (memory_get_usage() / 1024) . " KB" . PHP_EOL; echo "Memory usage after: " . (memory_get_usage() / 1024) . " KB" . PHP_EOL;
The output was:
Memory usage after: 5964.0625 KB
Memory usage after: KB 10019.421875
Edit: Strange tests:
1) If I test these parameters:
WHERE (f.latitude BETWEEN 45.64273082966722 AND 47.29965978937995) AND (f.longitude BETWEEN 4.93262593696295 AND 9.99999999999999)
I get 923 lines (normal behavior)
2) If I change the parameter 9.999999999999 to 10.000000000 (or some number is greater than 9.9999999), I get an empty result set in my application. The database still returns 923 rows (for 10.000000000).
EDIT: I could solve the problem discussed here: https://groups.google.com/d/msg/doctrine-user/qLSon6m4nM4/y5vLztHcbDgJ