You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@baremaps.apache.org by GitBox <gi...@apache.org> on 2022/11/30 13:10:47 UTC
[GitHub] [incubator-baremaps] Drabble opened a new issue, #544: Optimize the index to search by ip_start and ip_end
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: commits-unsubscribe@baremaps.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-baremaps] Drabble closed issue #544: Optimize the index to search by ip_start and ip_end
Posted by GitBox <gi...@apache.org>.
Drabble closed issue #544: Optimize the index to search by ip_start and ip_end
URL: https://github.com/apache/incubator-baremaps/issues/544
--
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: commits-unsubscribe@baremaps.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org