Use an index to identify differences for it to work best.

I would do an index on Citi alone.  Let the State just be a simple scan as
a speed test.  Then add an index on State but I do not think you are
going to gain any leverage from it.

Indexes find what you want quickly.  < is a comparison and not good for an
index Seek, only an index scan.





On Fri, Nov 3, 2017 at 4:09 PM, <mbsoftwaresoluti...@mbsoftwaresolutions.com
> wrote:

> VFP9SP2 free table
>
> I've got a table with this structure:
>
> city c(30)
> state c(2)
> radius i
> distance i
>
> My query is looking for city, state, and radius, to get back those whose
> distance is <= InputParameter.
>
> select *
>   from MyTable
>  where city = m.tcCity and state = m.tcState and radius <= m.tiRadius
>
> Not sure if I should
> index on city tag city
> index on state tag state
> index on radius tag radius
>
> or
>
> index on city + state + padl(allt(str(radius)),6,'0') tag MyTag
>
> ???
>
> I know I can use SYS(3054) to get my answer but I'm getting ready to be
> away from the office for a bit and was hoping someone knew the obvious
> answer.  Otherwise I'll run my testing later tonight.
>
> (At the very least, hopefully somebody learned about SYS(3054,x,y) today.)
>
[excessive quoting removed by server]

_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/cajidmyl3wydwbgz315dmd97_gonfyxv3orqb44e++mec9o0...@mail.gmail.com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to