From f0754086417bc39fd5ebe7c41bc28170bc41ef0e Mon Sep 17 00:00:00 2001 From: "Matthias@Dell" Date: Mon, 26 Jun 2023 20:50:18 +0200 Subject: [PATCH] added indexes for improved speed --- regina/sql/create_db.sql | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/regina/sql/create_db.sql b/regina/sql/create_db.sql index 1341838..1830b75 100644 --- a/regina/sql/create_db.sql +++ b/regina/sql/create_db.sql @@ -77,3 +77,9 @@ CREATE TABLE IF NOT EXISTS country( name TEXT UNIQUE, code TEXT UNIQUE ) STRICT; + +-- indexes for rankings +CREATE INDEX visitors_human_idx ON visitor(is_human); +CREATE INDEX visitors_ip_range_idx ON visitor(ip_range_id); +CREATE INDEX visitors_ip_range_human_idx ON visitor(is_human, ip_range_id); +CREATE INDEX requests_visitor_time_idx ON request(visitor_id, time);