Drabble opened a new issue, #544:
URL: https://github.com/apache/incubator-baremaps/issues/544
Currently we have only two indexes in Iploc, one for ip_start and one for
ip_end. As our IP query searches for ranges, it uses both variables in the
where clause.
We should create an index that includes both fields ip_start and ip_end to
optimize the following query:
```sql
SELECT id,
address,
ip_start,
ip_end,
latitude,
longitude,
network,
country
FROM inetnum_locations
WHERE ip_start >= 0
AND ip_end <= 0
ORDER BY ip_start DESC;
```
Using `EXPLAIN QUERY PLAN` we can see that the following query uses only the
ip_start_index : `SEARCH inetnum_locations USING INDEX ip_start_index
(ip_start>?)`.
The query takes around 6 seconds which is suboptimal.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]