You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@baremaps.apache.org by ad...@apache.org on 2022/12/01 09:49:56 UTC

[incubator-baremaps] branch main updated: Create a new index that includes both ip_start and ip_end (#545)

This is an automated email from the ASF dual-hosted git repository.

adrabble pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-baremaps.git


The following commit(s) were added to refs/heads/main by this push:
     new b253f825 Create a new index that includes both ip_start and ip_end (#545)
b253f825 is described below

commit b253f8258cd5633d91dfcd1fbd08d93e054de59b
Author: Antoine Drabble <an...@gmail.com>
AuthorDate: Thu Dec 1 10:49:52 2022 +0100

    Create a new index that includes both ip_start and ip_end (#545)
    
    For the Iploc module I have create a new index to replace the previous ones. It will index on ip_start and then on ip_end. This will greatly reduce the query time to find IPs in a range.
---
 baremaps-core/src/main/resources/iploc_init.sql | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/baremaps-core/src/main/resources/iploc_init.sql b/baremaps-core/src/main/resources/iploc_init.sql
index 0becaa78..6ad3a943 100644
--- a/baremaps-core/src/main/resources/iploc_init.sql
+++ b/baremaps-core/src/main/resources/iploc_init.sql
@@ -9,5 +9,4 @@ CREATE TABLE IF NOT EXISTS inetnum_locations (
     network text,
     country text
 );
-CREATE INDEX ip_start_index ON inetnum_locations (ip_start);
-CREATE INDEX ip_end_index ON inetnum_locations (ip_end);
\ No newline at end of file
+CREATE INDEX inetnum_locations_ips ON inetnum_locations (ip_start,ip_end);
\ No newline at end of file