we did something like this a while back.

i remember we AND'ed what you basically have now with a number of less than and 
greater than expressions to "box" the circle that you describe in your statement.

this "boxing" of the area merely provided a way to quickly limit the number of rows 
against which the sqrt(pow... stuff could limit down further into a circle.

the <, >, expressions could use indexes whereas the sqrt/pow stuff can't.

greg.
> 
> From: "Leo G. Divingracia III" <[EMAIL PROTECTED]>
> Subject: Re: Trouble converting SQL from Access
> Date: 03/01/2003 13:08:57
> To: "Asendorf John" <[EMAIL PROTECTED]>
> CC: [EMAIL PROTECTED],   [EMAIL PROTECTED]
> 
> Asendorf, John wrote:
> .
> > 
> > SELECT Dealers.*, SQRT(POW((2285-Zips.North),2)+POW((4760-Zips.West),2)) AS
> > Distance
> > FROM Dealers 
> > INNER JOIN Zips ON Dealers.Zip = Zips.Zip
> > ORDER BY POW((2285-Zips.North),2)+POW((4760-Zips.West)),2)
> > 
> > Any suggestions to speed this guy up? 
> 
> yeah, do you really need ALL the columns returned?
> 
> also, if you can, offload the calculations to PHP*, like the POW() 
> function...
> 
> 
> grab the data from MYSQL and then use PHP to do the calcs...*
> 
> 
> -- 
> Leo G. Divinagracia III
> [EMAIL PROTECTED]
> 
> zzzzz
> 
> 
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
> 
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
> 
> 

This message was sent through MyMail http://www.mymail.com.au



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to