summaryrefslogtreecommitdiff
path: root/src/schema.sql
diff options
context:
space:
mode:
authorDan Goodliffe <dan.goodliffe@octal.co.uk>2026-04-23 10:11:13 +0100
committerDan Goodliffe <dan.goodliffe@octal.co.uk>2026-04-23 10:11:13 +0100
commit7c59f2b66284b5b561c5368a0c834640ae0e611e (patch)
tree52283c0147c33317e0683638ab88ae1828a91b20 /src/schema.sql
parent7a66f1241f4a6ec570a5c41490ee3698eeeaf66e (diff)
downloadwebstat-7c59f2b66284b5b561c5368a0c834640ae0e611e.tar.bz2
webstat-7c59f2b66284b5b561c5368a0c834640ae0e611e.tar.xz
webstat-7c59f2b66284b5b561c5368a0c834640ae0e611e.zip
Add BRIN index to access_log.request_time and improve purge
Purge is now fully request_time based and not hacked around id ranges.
Diffstat (limited to 'src/schema.sql')
-rw-r--r--src/schema.sql2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/schema.sql b/src/schema.sql
index b211505..9d39bcd 100644
--- a/src/schema.sql
+++ b/src/schema.sql
@@ -107,6 +107,8 @@ CREATE TABLE access_log(
CONSTRAINT fk_access_log_content_type FOREIGN KEY (content_type) REFERENCES entities(id) ON UPDATE CASCADE
);
+CREATE INDEX idx_access_log_request_time ON access_log USING BRIN(request_time) WITH (autosummarize = TRUE);
+
CREATE OR REPLACE VIEW access_log_view AS
SELECT
l.id,