[TYPO3-dev] Remove records from extbase query result

Xavier Perseguers xavier at typo3.org
Wed Jan 15 10:39:49 CET 2014


Hi,

>> For an actual *radius* I have to compute the distance between the
>> location and each object. This can not be done as a query constraint. So
>> I have to narrow down the result later.
>>
> 
> are you sure?
> you may use your restrictions to a square area to get a first and easy
> selection and afterwards (if SQL optimizes the query-selections) compute
> the radius by only using squares which are less expensive than squareroots
> 
> sqrt( dX^2 + dY^2) = r    <=>   dX^2 + dY^2 = r^2

Dirk is right here, of course you may do it in pure SQL but it will lead
to a full table scan whereas Dirk's solution with a two-step query (one
in SQL, the other in PHP) leads to using the SQL indexes and is much
more efficient as soon as you have many records.

Kind regards

-- 
Xavier Perseguers
TYPO3 CMS Team Member

TYPO3 .... inspiring people to share!
Get involved: http://typo3.org




More information about the TYPO3-dev mailing list