I am using a connection between a geo-location data table - MyQuery and a VirtualTable. I need speed as there are 100,000 records and it's a loop. Each row has a start and end numeric range for a country.
I would like to do the equivalent of this SQL in VirtualTable using locate if it's the fastest way:
SELECT
iwin.geo.CountryCode,
iwin.geo.CountryName
FROM
iwin.geo
WHERE
404232216 >= iwin.geo.StartIPNum AND
404232216 <= iwin.geo.EndIPNum LIMIT 1
Please could you illustrate this, as I am having some difficulty. I am not even sure it's possible with VT to search for a row by range.
Secondly, shoudl I index these integer columns for faster performance -if so, how ?
Brain hurting

Kind regards
Jon